functionstripped_lengthpureprivate
pure integer function stripped_length(s)
Length of s without leading and trailing whitespace.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| s | character(len=*) | in | the string |
Result
| Name | Type | Attributes | Description |
|---|---|---|---|
| stripped_length | integer |
Source
Show the code
pure integer function stripped_length(s)
character(len=*), intent(in) :: s !! the string
integer :: a
a = verify(s, WHITESPACE)
stripped_length = 0
if (a > 0) stripped_length = verify(s, WHITESPACE, back=.true.) - a + 1
end function stripped_length