strim Function

private elemental function strim(self) result(trimmed)

Arguments

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

Return Value type(string)


Called by

proc~~strim~2~~CalledByGraph proc~strim~2 strim interface~trim~2 trim interface~trim~2->proc~strim~2

Contents

Source Code


Source Code

   elemental function strim(self) result(trimmed)
   !< Remove trailing spaces.
   !<
   !<```fortran
   !< type(string) :: astring
   !< astring = 'Hello World!   '
   !< print "(L1)", astring%trim()==trim('Hello World!   ')
   !<```
   !=> T <<<
   class(string), intent(in) :: self    !< The string.
   type(string)              :: trimmed !< Trimmed string.

   trimmed = self
   if (allocated(trimmed%raw)) trimmed%raw = trim(trimmed%raw)
   endfunction strim