Skip to content

Instantly share code, notes, and snippets.

@benjamincharity
Created May 21, 2015 16:01
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 benjamincharity/831f253864dcf6138b02 to your computer and use it in GitHub Desktop.
Save benjamincharity/831f253864dcf6138b02 to your computer and use it in GitHub Desktop.
Strip all non-digit characters.
newValue = oldValue.replace(/[^0-9]/g, "");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment