javascript String indexOf( )
indexOf( ) | Firefox/Netscape/NN 2 IE 3 ECMA 1 |
indexOf(searchString[, startPositionIndex]) | |
Returns a zero-based integer of the position within the current string where the searchString parameter starts. Normally, the search starts with the first (index of zero) character, but you may have the search begin later in the string by specifying the optional second parameter, which is the index value of where the search should start. If there is no match, the returned value is -1. This is a backward-compatible quick way to find out if one string contains another: if the returned value is -1 then you know the searchString is not in the larger string. If the returned value is another number (the precise value doesn't matter), the searchString is in the larger string. For browsers that support regular expressions, the String object's search( ) method performs a similar function. |
|
Parameters | |
|
|
Returned Value | |
Integer. |
Powered by Linode.