jquery string contains substring code example
Example 1: if str contains jquery
if (str.indexOf("Yes") >= 0)
//case insensitive version
if (str.toLowerCase().indexOf("yes") >= 0)
Example 2: check if word is in string javascript
var str = "Hello world, welcome to the universe.";
var n = str.includes("world");
Example 3: jquery check if string contains specific word
var a = 'how are you';
a.includes('are'); // will return true if string contains search term