dm_string_count_substring Function

public pure elemental function dm_string_count_substring(string1, string2) result(count)

Returns the number of occurences of string2 in string1.

Arguments

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

Haystack string.

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

Needle string.

Return Value integer