search inside a string javascript

JavaScript
var string = "Hello world!";
var n = string.search("w"); //now n equals 6
Source

Also in JavaScript: