Skip to main content

$$split

Splits a string using a given delimiter/regex

Usage​

{ 
"$$split": /* String to split */,
"delimiter": "" /* string */,
"limit": 0 /* integer */
}
"$$split([delimiter],[limit]):{input}"
note

Concrete values in the usage example are default values.

Returns​

string[]

Arguments​

ArgumentTypeValuesRequired / Default ValueDescription
PrimarystringYesString to split
delimiterstring""Delimiter to split by (can be a regular expression)
limitinteger0Limit the amount of elements returned (and by that, the amount the pattern get matched).  - 0 - Means no limit.

Examples​

Input

Definition

Output

"hello world"
"$$split:$"
[
"h",
"e",
"l",
"l",
"o",
" ",
"w",
"o",
"r",
"l",
"d"
]
"hello world"
"$$split(' '):$"
[
"hello",
"world"
]
"hello world"
"$$split(ll):$"
[
"he",
"o world"
]
"hello world"
"$$split(ll?):$"
[
"he",
"o wor",
"d"
]
"hello world"
"$$split(o,2):$"
[
"hell",
" world"
]