Returns the index within this string of the first occurrence of the specified substring, starting at the specified index.
The returned index is the smallest 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 from which to start the search. |
-1
if there is no such occurrence.
Diagram: String