Updated on Kisan Patel
How to Check if string contains a substring in JavaScript?
javascript string contains
Solution 1:
var string = "foo", substring = "oo"; console.log(string.includes(substring));
Solution 2:
var str = "Hello world, welcome to the universe."; var n = str.includes("world");