Returns the index within this string of the last occurrence of the specified substring, searching backward starting at the specified index.
The returned index is the largest value k for which:
If no such value of k exists, thenk <= fromIndex && this.startsWith(str, k)
-1
is returned.
str | the substring to search for. | |
fromIndex | the index to start the search from. |
-1
if there is no such occurrence.
Diagram: String