how to find substring in javascript includes code example
Example 1: angular string contains
var string = "foo";
var substring = "oo";
console.log(string.indexOf(substring) !== -1);
Example 2: js string does not contain
"this is the string".indexOf("cake"); // -1 (does not contain)
"this string has cake".indexOf("cake"); // 16 (contains)