Returns the index within this string of the first occurrence of the specified substring.
The returned index is the smallest 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