jQuery String Contains Manipulation?

This is done with indexOf, however it returns -1 instead of False if not found.

Syntax
string.indexOf(searchValue[, fromIndex])

Parameters
searchValue
A string representing the value to search for.
fromIndex
The location within string to start the search from. It can be any integer between 0 and the length of string. The default value is 0.

Return
The first index in string at which the start of the substring can be found, or -1 if string does not contain any instances of the substring.

Leave a Comment

tech