Strip out leading and trailing white spaces from a string.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
String to be modified. |
New modified string.
pure function wstrip(string) result(newstring) !< Strip out leading and trailing white spaces from a string. character(len=*), intent(in) :: string !< String to be modified. character(len=:), allocatable :: newstring !< New modified string. allocate(newstring, source=trim(adjustl(string))) endfunction wstrip