The strIndexOf() method, given two arguments: the string and a substring to search for, searches
the entire calling string, and returns the index of the first occurrence of the specified substring.
Given a thrid argument: a number, the method returns the first occurrence of the specified substring
at an index greater than or equal to the specified number.
// However, if the thrid argument is greater than the length of the string strIndexOf('hello world', '', 11) // returns 11 strIndexOf('hello world', '', 13) // returns 11 strIndexOf('hello world', '', 22) // returns 11
The
strIndexOf()
method, given two arguments: the string and a substring to search for, searches the entire calling string, and returns the index of the first occurrence of the specified substring. Given a thrid argument: a number, the method returns the first occurrence of the specified substring at an index greater than or equal to the specified number.Example