functionjoined_lengthpureprivate
pure integer function joined_length(list, sep)
Length of the result of join.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| list | type(string_t) | in | dimension(:) | the strings |
| sep | character(len=*) | in | the separator |
Result
| Name | Type | Attributes | Description |
|---|---|---|---|
| joined_length | integer |
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