slen_trim Function

private elemental function slen_trim(self) result(l)

Arguments

TypeIntentOptionalAttributesName
class(string), intent(in) :: self

Return Value integer


Called by

proc~~slen_trim~~CalledByGraph proc~slen_trim slen_trim interface~len_trim len_trim interface~len_trim->proc~slen_trim

Contents

Source Code


Source Code

   elemental function slen_trim(self) result(l)
   !< Return the length of a string, ignoring any trailing blanks.
   !<
   !<```fortran
   !< type(string) :: astring
   !< astring = 'Hello World!   '
   !< print "(L1)", astring%len_trim()==len_trim('Hello World!   ')
   !<```
   !=> T <<<
   class(string), intent(in) :: self !< The string.
   integer                   :: l    !< String length.

   if (allocated(self%raw)) then
      l = len_trim(string=self%raw)
   else
      l = 0
   endif
   endfunction slen_trim