hasWord
v1.0.1
Published
A string method to check if a given string contains a specific word
Downloads
15
Maintainers
Readme
hasWord()
** A string method to check to see if a string contains a word. **
'this is a test string'.hasWord('test'); returns true
'this is a test string'.hasWord('node'); returns false
Of course this works with variables as well:
let string = 'this is a test';
string.hasWord('test'); returns true
string.hasWord('node'); returns false