Return the length of a string, ignoring any trailing blanks.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(string), | intent(in) | :: | self | The string. |
String length.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module.
elemental function slen_trim(self) result(l)
!---------------------------------------------------------------------------------------------------------------------------------
!< Return the length of a string, ignoring any trailing blanks.
!---------------------------------------------------------------------------------------------------------------------------------
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
return
!---------------------------------------------------------------------------------------------------------------------------------
endfunction slen_trim