apoc.text.split

Function

apoc.text.split(text String, regex String, limit Integer) - splits the given string using a given regular expression as a separator.

Signature

apoc.text.split(text :: STRING?, regex :: STRING?, limit = 0 :: INTEGER?) :: (LIST? OF ANY?)

Input parameters

Name Type Default

text

STRING?

null

regex

STRING?

null

limit

INTEGER?

0

Usage Examples

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

["Hello", World"]

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

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

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

["Hello", "World"]