Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | text | Text to search |
||
character(len=*), | intent(in) | :: | str | String to look for |
Test if text ends with str
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | k |
function endsWith(text,str) result(o)
!! Test if text ends with str
character(*),intent(in)::text
!! Text to search
character(*),intent(in)::str
!! String to look for
logical::o
integer::k
k = len(text)
o = text(k-len(str)+1:k)==str
end function endsWith