apoc.text.indexOfFunctionDeprecated in Cypher 25
|
This function is deprecated.
Use Cypher’s |
Syntax |
|
||
Description |
Returns the first occurrence of the lookup |
||
Arguments |
Name |
Type |
Description |
|
|
The string to search for the lookup string in. |
|
|
|
The lookup string to search for in the given string. |
|
|
|
The index at which to start the search. The default is: |
|
|
|
The index at which to stop the search. The default is: |
|
Returns |
|
||
Usage Examples
The following returns the first occurrence of the lookup string in the given string using both APOC and Cypher:
apoc.text.indexOf
RETURN apoc.text.indexOf("Hello World", 'Hello') AS output;
Using Cypher’s string.indexOf
RETURN string.indexOf("Hello World", 'Hello') AS output;
| output |
|---|
0 |
The following returns the first occurrence of 'Hello' starting from index 3 using both APOC and Cypher:
apoc.text.indexOf
RETURN apoc.text.indexOf("Hello World, Hello", 'Hello', 3) AS output;
Using Cypher’s string.indexOf
WITH 3 AS start
RETURN string.indexOf(substring("Hello World, Hello", start), 'Hello') + start AS output;
| output |
|---|
13 |