fdoc

functionends_withpure

pure logical function ends_with(s, suffix)

True if s finishes with suffix.

Arguments

NameTypeIntentAttributesDescription
scharacter(len=*)in

the string

suffixcharacter(len=*)in

the end wanted

Result

NameTypeAttributesDescription
ends_withlogical

Source

Show the code
pure logical function ends_with(s, suffix)
    character(len=*), intent(in) :: s        !! the string
    character(len=*), intent(in) :: suffix   !! the end wanted
    ends_with = len(s) >= len(suffix)
    if (ends_with) ends_with = s(len(s) - len(suffix) + 1:) == suffix
end function ends_with

Graphs

Called by