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 starts with str
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | k |
function startsWith(text,str) result(o)
!! Test if text starts with str
character(*),intent(in)::text
!! Text to search
character(*),intent(in)::str
!! String to look for
logical::o
integer::k
k = len(str)
o = text(1:k)==str
end function startsWith