join
Joins a list of strings into a single string using a specified separator.
Syntax
join(separator, source_list)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| separator | string | Yes | The separator string to insert between each element. |
| source_list | list[string] | Yes | The list of strings to join together. |
Returns
Type: string
A single string with all list elements concatenated, separated by the given separator. Returns an empty string if the list is empty.
Examples
Join a list with commas:
join(", ", [tags])
If tags is ["network", "urgent", "vpn"], the result is "network, urgent, vpn".
Join with a newline separator:
join("\n", [comments])
If comments is ["First comment", "Second comment"], the result is:
First comment
Second comment
Combine with split for delimiter replacement:
join(" | ", split([categories], ","))
If categories is "Hardware,Software,Network", the result is "Hardware | Software | Network".
Notes
- If
source_listis empty orNone, the function returns an empty string"". - All elements in the list should be strings. Use
concatenateor string conversion if your list contains non-string values. - This is the inverse of the
splitfunction.
Comments
0 comments
Please sign in to leave a comment.