FindStr
FindStr( value, find, [start] )
FindStr( value, find, [start] )
FindStr( value, find, [start] )
FindStr( value, find, [start] )
find_str( value, find, [start] )
FindStr( value, find, [start] )
Description
The FindStr
function returns the offset position of a string within
another string, or -1 if the string is not found.
Parameters
Parameter | Type | Definition and Requirements | ||
---|---|---|---|---|
|
The String to search in. |
|||
|
The String to search for. |
|||
|
Optional - The position in the
|
Returns
A Integer indicating the position where the find
string
starts. If the find
string is not found in the value
string, -1 is
returned.
Examples
The following query 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 first 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.
Arr(LongV(0), LongV(9))
[0 9]
[0, 9]
[ 0, 9 ]
[0, 9]
[ 0, 9 ]
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!