Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(string), | intent(in) | :: | self |
elemental function slen(self) result(l)
!< Return the length of a string.
!<
!<```fortran
!< type(string) :: astring
!< astring = 'Hello World! '
!< print "(L1)", astring%len()==len('Hello World! ')
!<```
!=> T <<<
class(string), intent(in) :: self !< The string.
integer :: l !< String length.
if (allocated(self%raw)) then
l = len(string=self%raw)
else
l = 0
endif
endfunction slen