apoc.text.split

Details

Syntax

apoc.text.split(text, regex [, limit ])

Description

Splits the given STRING using a given regular expression as a separator.

Arguments

Name

Type

Description

text

STRING

The string to split.

regex

STRING

The delimiting regular expression.

limit

INTEGER

The number of times the regex pattern is applied; if set to 0, it will be applied as many times as possible. The default is: 0.

Returns

LIST<ANY>

Usage Examples

RETURN apoc.text.split('Hello World', ' ') AS output;
Results
output

["Hello", World"]

RETURN apoc.text.split('Hello  World', ' ') AS output;
Results
output

["Hello", "", "World"]

RETURN apoc.text.split('Hello   World', ' +') AS output;
Results
output

["Hello", "World"]