Created
December 20, 2017 16:59
-
-
Save MSerj/ac76025d376080e175cd1d71eb26bcbd to your computer and use it in GitHub Desktop.
JavaScript get number from string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var txt = "#div-name-1234-characteristic:561613213213"; | |
var numb = txt.match(/\d/g); | |
numb = numb.join(""); | |
alert (numb); | |
//result | |
1234561613213213 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment