fazlurr
8/21/2015 - 10:46 AM

Check if string contain a word - http://stackoverflow.com/a/21081760/4549947

Check if string contain a word - http://stackoverflow.com/a/21081760/4549947

function wordInString(s, word){
  return new RegExp( '\\b' + word + '\\b', 'i').test(s);
}

wordInString('did you, or did you not, get why?', 'you')  // true