SPLIT

Split a text into a list of texts by dividing at the delimiter.

The delimiter is not included in the list.

Usage

SPLIT(text, delimiter, max_parts: 0)

Parameters

text

(Required) The text to split

delimiter

(Required) The delimiter to use for splitting

max_parts:

(Named, Required) Maximum number of parts in the resulting list. Use 0 (the default) for any number of parts.

Parameters with “Named” mean that you must specify the name of the parameter and a colon before its value. Ex: max_parts: "its value"

Examples

Example With these variables Result

SPLIT(“Anna Logwatch”, “ “)

(None)

[“Anna”, “Logwatch”]

SPLIT(text, “,”)

text is "a,b,c,d,e"

[“a”, “b”, “c”, “d”, “e”]

SPLIT(text, “,”, max_parts: 3)

text is "a,b,c,d,e"

[“a”, “b”, “c,d,e”]

INDEX(SPLIT(text, “,”), 4)

text is "a,b,c,d,e"

“d”

SPLIT(“repeated,,,delimiter”, “,”)

(None)

[“repeated”, “”, “”, “delimiter”]

SPLIT(“,delimiter,at,start”, “,”)

(None)

[””, “delimiter”, “at”, “start”]

SPLIT(“delimiter,at,end,”, “,”)

(None)

[“delimiter”, “at”, “end”, “”]

More information

The [ and ] in the examples represents the beginning and end of lists.

Using INDEX with SPLIT allows getting only the part of interest.

If there are too many instances of the delimiter in the text, the last text of the list will include the extra delimiters.

The resulting list may contain empty texts in the following cases:

  • there are consecutive delimiters
  • there is a delimiter at the beginning of the text
  • there is a delimiter at the end of the text

See also