ends_with Function

private pure function ends_with(s, suffix)

True if string s ends with suffix.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: s

the string, and the ending to look for

character(len=*), intent(in) :: suffix

the string, and the ending to look for

Return Value logical


Called by

proc~~ends_with~~CalledByGraph proc~ends_with ends_with proc~config_for config_for proc~config_for->proc~ends_with proc~directory_files directory_files proc~directory_files->proc~config_for proc~options_for options_for proc~options_for->proc~config_for proc~process_text process_text proc~process_text->proc~options_for proc~run run proc~run->proc~directory_files proc~process_file process_file proc~run->proc~process_file proc~process_stdin process_stdin proc~run->proc~process_stdin proc~process_file->proc~process_text proc~process_stdin->proc~process_text

Source Code

pure logical function ends_with(s, suffix)
    !! True if string `s` ends with `suffix`.
    character(len=*), intent(in) :: s, suffix   !! the string, and the ending to look for
    ends_with = .false.
    if (len(s) >= len(suffix)) ends_with = s(len(s) - len(suffix) + 1:) == suffix
end function ends_with