fdoc

functionjoined_lengthpureprivate

pure integer function joined_length(list, sep)

Length of the result of join.

Arguments

NameTypeIntentAttributesDescription
listtype(string_t)indimension(:)

the strings

sepcharacter(len=*)in

the separator

Result

NameTypeAttributesDescription
joined_lengthinteger

Source

Show the code
pure integer function joined_length(list, sep)
    type(string_t), intent(in) :: list(:)   !! the strings
    character(len=*), intent(in) :: sep     !! the separator
    integer :: k

    joined_length = len(sep)*max(0, size(list) - 1)
    do k = 1, size(list)
        joined_length = joined_length + len(list(k)%s)
    end do
end function joined_length