Skip to content

Instantly share code, notes, and snippets.

@RoryDuncan
Created March 1, 2014 22:25
Show Gist options
  • Save RoryDuncan/9298426 to your computer and use it in GitHub Desktop.
Save RoryDuncan/9298426 to your computer and use it in GitHub Desktop.
var contains = function(text, word) {
if ( text.split(word).length > 1 ) return true;
return false;
};
// test:
var s = "wow a really long string that I'm going to search through";
contains(s, "that");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment