public int indexOf(String str)
Returns the index within this string of the first occurrence of the specified substring. The integer returned is the smallest value k such that:
str - any string.
if the string argument occurs as a substring within this object, then the index of the first character of the first such substring is returned; if it does not occur as a substring, -1 is returned.
The word "Fool" appears in the string "Foolish boy." at the beginning - index 0.
Can you explain in more detail what exactly you don't understand about that?