IndexOf() function returns the index of a string within another string. Will return 0 if the string was not found.
This function is case insensitive.
Index of the string that is found within another string. If the string is not found, the function will return 0. The index of the first character is 1, the second character is 2, etc.
- searchInString – the is the string in which the function will search for the searchString
- searchString – this is the string that is searched for
IndexOf("The quick brown fox jumps over the lazy dog", "JUMPS") /* returns 21 */ IndexOf("The quick brown fox jumps over the lazy dog", "JUMPED") /* returns 0 */