SPLIT

Description

Returns an array of substrings by splitting a string using a regular expression delimiter.

Syntax

SPLIT(string, regex) -> String[]

Parameters

ParameterData TypeRequiredDescription
stringStringYesThe input string to split.
regexStringYesThe regular expression used as the delimiter.

Example

SPLIT("Sales, Marketing;  Support,  Finance", "[,;\s]+")
-- Returns ["Sales", "Marketing", "Support", "Finance"].

Tips

  • If regex does not match any part of string, SPLIT returns a single-element array with the original string.