FINDSTR - String
Returns the position of the second string in the first string, or -1 if it is not contained.
Input parameters
Name | Type | Optional | Description |
---|---|---|---|
str |
String | False | String to search in |
substr |
String | False | String to search for |
Output
Number: offset of substr
in str
or -1
Usage
FINDSTR(<str>, <substr>)
Examples
Example 1
Query
LOAD tmp
AS ('': FINDSTR("Hello World", "World"))
Result
6
Example 2
Query
LOAD tmp
AS ('': FINDSTR("Hello World", "John"))
Result
-1