FindStr
Not available in this language yet.
FindStr( value, find, [start] )
FindStr( value, find, [start] )
FindStr( value, find, [start] )
Not available in this language yet.
FindStr( value, find, [start] )
Description
The FindStr
function returns the offset position of a string in
another string, or -1 if the string is not found.
Parameters
Argument | Type | Definition and Requirements | ||
---|---|---|---|---|
|
String |
The string to search in. |
||
|
String |
The string to search for. |
||
|
String |
Optional - The position in the value string where the search
starts. The default value, if omitted, is 0 characters. The first
position in the string is 0. If the value is less than 0, then the
|
Returns
A integer value of where the find string starts. If the find string is not found in the value string, then -1 is returned.
Examples
The query below executes an array of independent FindStr
operations
and returns the results in an array. The result array position matches
the execution array position. The first operation takes a string to
search ("fire and fireman"), locates the first occurrence of the search
string "fire", and places the offset in the top position of the result
array. The second operation uses the same search string ("fire and
fireman") and attempts to locate the first occurrence of the word "fire"
after the fourth character in the string. The result of 9 is placed
into the second position of the result array.
Not available in this language yet.
Not available in this language yet.
System.out.println(
client.query(
Arr(
FindStr("fire and fireman", "fire"),
FindStr("fire and fireman", "fire", 4)
)
).get());
[0, 9]
Not available in this language yet.
Not available in this language yet.
Not available in this language yet.
Is this article helpful?
Tell Fauna how the article can be improved:
Visit Fauna's forums
or email docs@fauna.com
Thank you for your feedback!