Skip to content

split

split(target, source)

Splits target string into an array of substrings using source string or regular expression as the separator.

ts
split("hello,world,test", ","); // ["hello", "world", "test"]
split("hello world", /\s+/); // ["hello", "world"]
ts
pipe("hello,world,test", split(",")); // ["hello", "world", "test"]
pipe("hello world", split(/\s+/)); // ["hello", "world"]