public int indexOf (String str)

Returns the index within this string of the first occurrence of the specified substring.

The returned index is the smallest value k for which:

 this.startsWith(str, k)
 
If no such value of k exists, then -1 is returned.

Parameters:
str    the substring to search for.

Returns:  the index of the first occurrence of the specified substring, or -1 if there is no such occurrence.