I need to check whether a string contains another string or not?
var str1 = "ABCDEFGHIJKLMNOP";
var str2 = "DEFG";
Which function do I use to find out if str1 contains str2?
I need to check whether a string contains another string or not?
var str1 = "ABCDEFGHIJKLMNOP";
var str2 = "DEFG";
Which function do I use to find out if str1 contains str2?
it will return the position of the match, or -1 if it isn't found.
simply on foreach loop with you can compare ,separated to strings
You can use javascript's indexOf function.