Returns the index within the specified string of the first occurence of the specified substring, starting at the specified index.

Parameters:

str

The string to be searched in.
search
The substring to search for.
fromIndex
The index to start the search from. If not specified, 0 is assumed.

See Also:

lastIndexOf()
Tip:

You may call this function in a method-like style, e.g.:

str.indexOf("blah",5)