is_valid__in Function

public function is_valid__in(pattern, str, correct_answer) result(res)

This function checks if a pattern is found within a string and compares the result to the correct_answer.

Arguments

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

Return Value logical


Source Code

   function is_valid__in(pattern, str, correct_answer) result(res)
      implicit none
      character(*), intent(in) :: pattern, str
      logical,      intent(in) :: correct_answer

      logical :: res

      res = (pattern .in. str) .eqv. correct_answer
   end function is_valid__in