apoc.text.split

Function APOC Core

apoc.text.split(text, regex, limit) - splits the given text around matches of the given regex.

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"]