functionjoinpure
pure character(len=joined_length(list,sep)) function join(list, sep) result(text)
The strings of list with sep between them.
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 |
|---|---|---|---|
| text | character(len=joined_length(list,sep)) | private |
Called by
- apply_toml_string
- code_block
- definition_block
- doxygen_params
- entity_title
- expand_includes
- lexical_clean
- load_project
- loose_detab
- markdown_to_html
- normal_id
- quote_block
- read_page
- render_entity
- set_doc
- set_option
- stash_html_blocks
Source
Show the code
pure function join(list, sep) result(text)
type(string_t), intent(in) :: list(:) !! the strings
character(len=*), intent(in) :: sep !! the separator
character(len=joined_length(list, sep)) :: text
integer :: k, n
n = 0
do k = 1, size(list)
if (k > 1) then
text(n + 1:n + len(sep)) = sep
n = n + len(sep)
end if
text(n + 1:n + len(list(k)%s)) = list(k)%s
n = n + len(list(k)%s)
end do
end function join