Javascript String contains(string)
/**//from w w w . j a va 2s . c o m * Checks whether the string contains a given string. * * @method String.prototype.contains * @param {String} string The string to search for * @return {Boolean} True if the string contains a given string */ String.prototype.contains = function(string) { return this.indexOf(string) >= 0; };
String.prototype.contains = function(string) { return (this.indexOf(string) != -1); }