Right adjust a string by removing leading spaces (character output).
type(string) :: astring
astring = 'Hello World! '
print "(L1)", adjustr(astring)==' Hello World!'
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(string), | intent(in) | :: | s |
String. |
Adjusted string.
pure function sadjustr_character(s) result(adjusted) !< Right adjust a string by removing leading spaces (character output). !< !<```fortran !< type(string) :: astring !< astring = 'Hello World! ' !< print "(L1)", adjustr(astring)==' Hello World!' !<``` !=> T <<< class(string), intent(in) :: s !< String. character(kind=CK, len=:), allocatable :: adjusted !< Adjusted string. if (allocated(s%raw)) adjusted = adjustr(s%raw) endfunction sadjustr_character