functioncomma_countpureprivate
pure integer function comma_count(text)
Number of commas in text.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| text | character(len=*) | in | the text |
Result
| Name | Type | Attributes | Description |
|---|---|---|---|
| comma_count | integer |
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