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