Using javascript String.indexOf() .
var str = "A Google wave is basically a document which captures a communication"; if (str.indexOf("Google Wave") !== -1){
For your comparison, case insensitive and easy:
// makes any string have the function ".contains([search term[, make it insensitive]])" // usage: // var str = "Hello, world!"; // str.contains("hello") // false, it case sensitive // str.contains("hello",true) // true, the "True" parameter makes it ignore case String.prototype.contains = function(needle, insensitive){ insensitive = insensitive || false; return (!insensitive ? this.indexOf(needle) !== -1 : this.toLowerCase().indexOf(needle.toLowerCase()) !== -1 ); }
Oop, invalid document link. Link to array.indexOf
source share