How can I check if a string contains another string instead of using "==" to compare the whole string?
Regards
Answer
You can use .indexOf():
.indexOf()
if(str.indexOf(substr) > -1) {}
No comments:
Post a Comment