is_there_dollar_at_the_end Function

public pure function is_there_dollar_at_the_end(pattern) result(res)

This funciton returns .true. if the pattern contains the doller character at the end that matches the ending of a line.

Arguments

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

Return Value logical


Source Code

   pure function is_there_dollar_at_the_end(pattern) result(res)
      implicit none
      character(*), intent(in) :: pattern
      character(:), allocatable :: buff

      logical :: res

      res = .false.
      
      buff = trim(pattern)
      if (len(buff) == 0) return

      res = buff(len_trim(buff):len_trim(buff)) == '$'
   end function is_there_dollar_at_the_end