apoc.text.indexesOf
Function
apoc.text.indexesOf(text STRING, lookup STRING, from INTEGER, to INTEGER)
- returns all occurrences of the lookup STRING
in the given STRING
, or an empty list if not found.
Signature
apoc.text.indexesOf(text :: STRING, lookup :: STRING, from = 0 :: INTEGER, to = -1 :: INTEGER) :: LIST<ANY>
Usage Examples
RETURN apoc.text.indexesOf("Hello World, Hello, Hello", 'Hello') AS output;
output |
---|
[0, 13, 20] |
Starting from index 6, find the occurrences of 'Hello',
RETURN apoc.text.indexesOf("Hello World, Hello, Hello", 'Hello', 6) AS output;
output |
---|
[13, 20] |
Starting from index 6 up to index 20, find the occurrences of 'Hello',
RETURN apoc.text.indexesOf("Hello World, Hello, Hello", 'Hello', 6, 20) AS output;
output |
---|
[13] |