I would like to check if one string contains another, as if it were a
String.contains() method but apparently there is no method that does this.
Does anyone know of a similar method that does the same thing?
var s = "foo"; alert(s.indexOf("oo") != -1);
indexOf function returns the position of a string in another string or -1 if not found.