apoc.text.indexOf
Function
apoc.text.indexOf(text String, lookup String, from Integer, to Integer)
- returns the first occurrence of the lookup string in the given string, or -1 if not found.
Signature
apoc.text.indexOf(text :: STRING?, lookup :: STRING?, from = 0 :: INTEGER?, to = -1 :: INTEGER?) :: (INTEGER?)
Input parameters
Name | Type | Default |
---|---|---|
text |
STRING? |
null |
lookup |
STRING? |
null |
from |
INTEGER? |
0 |
to |
INTEGER? |
-1 |
Usage Examples
RETURN apoc.text.indexOf("Hello World", 'Hello') AS output;
output |
---|
0 |
Starting from index 3, find the first occurrence of 'Hello',
RETURN apoc.text.indexOf("Hello World, Hello", 'Hello', 3) AS output;
output |
---|
13 |
Was this page helpful?