fdoc

functioncomma_countpureprivate

pure integer function comma_count(text)

Number of commas in text.

Arguments

NameTypeIntentAttributesDescription
textcharacter(len=*)in

the text

Result

NameTypeAttributesDescription
comma_countinteger

Source

Show the code
pure integer function comma_count(text)
    character(len=*), intent(in) :: text    !! the text
    integer :: k
    comma_count = 0
    do k = 1, len(text)
        if (text(k:k) == ',') comma_count = comma_count + 1
    end do
end function comma_count