Skip to content

Instantly share code, notes, and snippets.

@barneycarroll
Created July 23, 2013 11:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barneycarroll/6061731 to your computer and use it in GitHub Desktop.
Save barneycarroll/6061731 to your computer and use it in GitHub Desktop.
Does the string (argument 1) contain a given substring (argument 2)?
function contains(string, substring){
return string.indexOf(substring) > -1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment