How can I check if a string contains another string instead of using "==" to compare the whole string?
Regards
This question is related to
javascript
node.js
string
You can use .indexOf()
:
if(str.indexOf(substr) > -1) {
}
Source: Stackoverflow.com