fdoc

functionstrippure

pure character(len=stripped_length(s)) function strip(s) result(t)

s without leading and trailing whitespace.

This and the other functions here that are used while parsing give their results an explicit length: gfortran keeps the length of a deferred-length result in static storage, so it is not safe in parallel regions (see example/slen_race.f90).

Arguments

NameTypeIntentAttributesDescription
scharacter(len=*)in

the string

Result

NameTypeAttributesDescription
tcharacter(len=stripped_length(s))private

Source

Show the code
pure function strip(s) result(t)
    character(len=*), intent(in) :: s   !! the string
    character(len=stripped_length(s)) :: t
    integer :: a
    a = verify(s, WHITESPACE)
    if (a > 0) t = s(a:)
end function strip

Graphs

Called by