fdoc

functioncount_newlinespureprivate

pure integer function count_newlines(text)

Number of line feeds in text.

Arguments

NameTypeIntentAttributesDescription
textcharacter(len=*)in

the text

Result

NameTypeAttributesDescription
count_newlinesinteger

Source

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

Graphs

Called by