I have a string in JavaScript like #box2 and I just want the 2 from it.
#box2
2
I tried:
var thestring = $(this).attr(\'href\'); var
And this is a snippet which extracts prices with currency and formatting:
var price = "£1,739.12"; parseFloat(price.replace( /[^\d\.]*/g, '')); // 1739.12