string_array_contains Function

public function string_array_contains(search_string, array)

Check if array of TYPE(STRING_T) matches a particular CHARACTER string

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: search_string
type(string_t), intent(in) :: array(:)

Return Value logical


Source Code

logical function string_array_contains(search_string,array)
    character(*), intent(in) :: search_string
    type(string_t), intent(in) :: array(:)

    integer :: i

    string_array_contains = any([(array(i)%s==search_string, &
                                   i=1,size(array))])

end function string_array_contains