We can use the indexOf() function to check if a string exists in another string.
var s = "foo";
alert(s.indexOf("oo") != -1);
it returns true if s contains “oo” and vice versa.
Done =)
We can use the indexOf() function to check if a string exists in another string.
var s = "foo";
alert(s.indexOf("oo") != -1);
it returns true if s contains “oo” and vice versa.
Done =)