Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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.

Examples


Join an array of strings with commas

# spq
values join(this, ",")
# input
["a","b","c"]
# expected output
"a,b,c"

Join non-string arrays by first casting

# spq
values join(cast(this, <[string]>), "...")
# input
[1,2,3]
[10.0.0.1,10.0.0.2]
# expected output
"1...2...3"
"10.0.0.1...10.0.0.2"