ends_with_char_char Function

private pure function ends_with_char_char(string, substring) result(match)

Check whether a string ends with substring or not

Arguments

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

Return Value logical


Called by

proc~~ends_with_char_char~~CalledByGraph proc~ends_with_char_char ends_with_char_char interface~ends_with ends_with interface~ends_with->proc~ends_with_char_char proc~ends_with_char_string ends_with_char_string interface~ends_with->proc~ends_with_char_string proc~ends_with_string_char ends_with_string_char interface~ends_with->proc~ends_with_string_char proc~ends_with_string_string ends_with_string_string interface~ends_with->proc~ends_with_string_string proc~ends_with_char_string->interface~ends_with proc~ends_with_string_char->interface~ends_with proc~ends_with_string_string->interface~ends_with

Variables

Type Visibility Attributes Name Initial
integer, private :: last
integer, private :: nsub

Source Code

   pure function ends_with_char_char(string, substring) result(match)
      character(len=*), intent(in) :: string
      character(len=*), intent(in) :: substring
      logical :: match
      integer :: last, nsub

      last = len(string)
      nsub = len(substring)
      if (last < nsub) then
         match = .false.
         return
      end if
      match = string(last - nsub + 1:last) == substring

   end function ends_with_char_char