join
.join iterable:{Iterable<Any>} \
separator:{InlineMarkdownContent = InlineMarkdownContent(listOf(Text(", ")))} \
body:{Lambda? = null}
-> NodeContent copied to clipboard
Merges the elements of a collection into a single inline content, placing separator between adjacent elements.
.var {letters}
- A
- B
- C
.letters::join <!-- A, B, C -->Content copied to clipboard
Like forEach, a body can transform each element before joining:
.letters::withindices::join
index letter:
.index **.letter**Content copied to clipboard
Output: 1 A, 2 B, 3 C
Return
the output of all iterations, joined by separator
Parameters
iterable
collection to iterate
separator
- Optional
- Likely named
inline content placed between the output of adjacent iterations. Defaults to ,
body
- Likely a body argument
- Optional
the inline output of each iteration. Accepts 1 parameter (the current element). If unset, each element is output as is
Chaining
This function is designed to be chained with other function calls:Iterable<Any>::join separator:{InlineMarkdownContent} \
body:{Lambda?}
-> NodeContent copied to clipboard