/

HTML / CSS / JavaScript Tutorial

JavaScript String method: search()

[this page | pdf | back links]

The search() method (when applied to a JavaScript string) returns the position of the first occurrence of the search value (or -1, if no match is found).

 

It has the following syntax with the following parameters:

 

string.search(regexpression)

 

Parameter

Required / Optional

Description

regexpression

Required

Value (regular expression) to be searched for

 


NAVIGATION LINKS
Contents | Prev | Next | JavaScript String Variables


Desktop view | Switch to Mobile