Skip to content

Instantly share code, notes, and snippets.

@JavaScript-Packer
Created July 24, 2015 10:04
Show Gist options
  • Select an option

  • Save JavaScript-Packer/99836b90c3843513b86a to your computer and use it in GitHub Desktop.

Select an option

Save JavaScript-Packer/99836b90c3843513b86a to your computer and use it in GitHub Desktop.
Function removes leading and trailing whitespace from string
function strip(e) {
return e.trim ? e.trim() : e.replace(/^\s+/, "").replace(/\s+$/, "");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment