Searches the string backwards for the specified substring, starting from the specified index, and returns an index to it.

Returns -1 if the substring is not found.

Parameters:

str

The string to be searched in.
search
The substring to search for.
fromIndex
The index to start the search from. If not specified, str.len()-1 is assumed.

See Also:

indexOf()
Tip:

You may call this function in a method-like style, e.g.:

str.lastIndexOf(".")