JQuery string contains check [duplicate]
You can use javascript's indexOf function.
var str1 = "ABCDEFGHIJKLMNOP";var str2 = "DEFG";if(str1.indexOf(str2) != -1){ console.log(str2 + " found");}
var str1 = "ABCDEFGHIJKLMNOP";var str2 = "DEFG";sttr1.search(str2);
it will return the position of the match, or -1 if it isn't found.