fdoc

functionreplace_commaspureprivate

pure character(len=len(attr)+comma_count(attr)) function replace_commas(attr) result(out)

attr with a blank after each comma.

Arguments

NameTypeIntentAttributesDescription
attrcharacter(len=*)in

the text

Result

NameTypeAttributesDescription
outcharacter(len=len(attr)+comma_count(attr))private

Source

Show the code
pure function replace_commas(attr) result(out)
    character(len=*), intent(in) :: attr    !! the text
    character(len=len(attr) + comma_count(attr)) :: out
    integer :: k, n

    n = 0
    do k = 1, len(attr)
        n = n + 1
        out(n:n) = attr(k:k)
        if (attr(k:k) == ',') then
            n = n + 1
            out(n:n) = ' '
        end if
    end do
end function replace_commas

Graphs

Called by