Returns the index within this string of the last occurrence of the
specified substring. The last occurrence of the empty string ""
is considered to occur at the index value this.length()
.
The returned index is the largest value k for which:
If no such value of k exists, thenthis.startsWith(str, k)
-1
is returned.
str | the substring to search for. |
-1
if there is no such occurrence.
Diagram: String