string.index
This function returns the index of the first instance of a substring in the input string.
Syntax
string.index(str, substr)
Arguments
Argument |
Type |
Description |
---|---|---|
str |
string |
Source string |
substr |
string |
Substring to be searched for in the source string |
Returns
Type |
Description |
---|---|
int |
|
Examples
The function string.index("hello flogo", "flogo")
returns 6
.