SPLIT

Description

SPLIT splits a string by a separator and returns a list of the resulting parts. An optional third argument limits the maximum number of splits performed; the remaining unsplit portion is returned as the last element.

Syntax

SPLIT(string, separator, max_splits?)

Returns: A list of strings.

Example

SPLIT('a,b,c,d', ',')

This returns ['a', 'b', 'c', 'd'].

Example with max splits

SPLIT('a,b,c,d', ',', 2)

This returns ['a', 'b', 'c,d'] — only two splits are performed, so the remainder is kept as a single element.

Last updated

Was this helpful?