fdoc

functionstarts_withpure

pure logical function starts_with(s, prefix)

True if s begins with prefix.

Arguments

NameTypeIntentAttributesDescription
scharacter(len=*)in

the string

prefixcharacter(len=*)in

the start wanted

Result

NameTypeAttributesDescription
starts_withlogical

Source

Show the code
pure logical function starts_with(s, prefix)
    character(len=*), intent(in) :: s        !! the string
    character(len=*), intent(in) :: prefix   !! the start wanted
    starts_with = len(s) >= len(prefix)
    if (starts_with) starts_with = s(1:len(prefix)) == prefix
end function starts_with

Graphs

Called by