join
Function
join — concatenate array of strings with a separator
Synopsis
join(val: [string], sep: string) -> string
Description
The join function concatenates the elements of string array val
to create a single
string. The string sep
is placed between each value in the resulting string.
Example:
Join a symbol array of strings:
yield join(this, ",")
["a","b","c"]
Loading...
echo '["a","b","c"]' \
| super -z -c 'yield join(this, ",")' -
Join non-string arrays by first casting:
yield join(cast(this, <[string]>), "...")
[1,2,3]
[10.0.0.1,10.0.0.2]
Loading...
echo '[1,2,3]
[10.0.0.1,10.0.0.2]' \
| super -z -c 'yield join(cast(this, <[string]>), "...")' -