FEEL

split

FEEL built-in function · FEEL string functions

split(string, delimiter)

Splits the string at every match of the delimiter pattern and returns the parts as a list of strings.

The delimiter is a regular expression. A plain comma or semicolon works as expected, but a dot or a pipe has to be escaped. Empty parts between consecutive delimiters are kept. A pattern such as \\s*,\\s* splits and trims in one step.

Parameters

ParameterTypeDescription
stringstringthe string to split
delimiterstringregular expression separating the parts

Examples

split("John Doe", "\\s")
[John, Doe] Try it ↑
split("a;b;c;;", ";")
[a, b, c, , ] Try it ↑

Edge cases and null handling

split("a.b.c", ".")
[, , , , , ] Try it ↑

Unescaped, the dot matches every character, which leaves only empty strings.

split("a.b.c", "\\.")
[a, b, c] Try it ↑
split("a,b,,c", ",")
[a, b, , c] Try it ↑

Empty parts are kept.

split("a, b ,c", "\\s*,\\s*")
[a, b, c] Try it ↑

Split and trim whitespace in one pattern.

split("", ",")
split(null, ",")

B-FEEL returns an empty list.

Related functions

string join · substring before · substring after

Defined by the OMG DMN 1.6 specification, chapter 10.3.4 (built-in functions).