count_chars Function

public function count_chars(str, char)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: str
character(len=1), intent(in) :: char

Return Value integer


Called by

proc~~count_chars~~CalledByGraph proc~count_chars count_chars proc~check_if_conversion_required check_if_conversion_required proc~check_if_conversion_required->proc~count_chars proc~fslink_init_part2 FSlink_init_part2 proc~fslink_init_part2->proc~check_if_conversion_required program~reims_p reims_p program~reims_p->proc~fslink_init_part2

Source Code

integer function count_chars(str, char)
character(len=*), intent(in) :: str
character(len=1), intent(in) :: char
integer :: i

count_chars = 0
do i = 1, len_trim(str)
    if (str(i:i) == char) then
        count_chars = count_chars + 1
    end if
end do
end function count_chars