Returns the position of the last occurrence of substr within string. By default, the function starts the search from the first character, which has position (index) 1, and ends the search at the last character, but you can optionally specify an ending index. If substr cannot be found, then the function returns 0.
Built-in, C++, C#, Java.
The input string.
The sub-string to search for.
Optional. Specifies the ending position (index) of the search. If this parameter is not specified, the search ends after the last character in string.
The following mapping outputs 8, which is the position of the last occurrence of the pipe character in the input string id|name|email.
If you specify 4 as ending index, then the function searches up to the fourth character. Consequently, the mapping below outputs 3.