Skip to content

Instantly share code, notes, and snippets.

@johnmichel
Created July 21, 2010 17:38
Show Gist options
  • Select an option

  • Save johnmichel/484822 to your computer and use it in GitHub Desktop.

Select an option

Save johnmichel/484822 to your computer and use it in GitHub Desktop.
Removes any leading zeroes from a string
// removes leading zeroes from a string
function removeZeroes(str) {
var zeroPattern = /^[0]*/;
return str.replace(zeroPattern,'');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment