I have these strings with numbers
"$12.3"
"12,3 SEK"
"12 pounds"
In all the occurrences i need to remove the number, float or not, and just keep the rest of the string.
"$"
"SEK"
"pounds"
I found several posts that are similar to my question, like this one: Removing Numbers from a String using Javascript
Where something like this is suggested in a comment:
"12.3 USD".replace(/\d+([,.]\d+)?/g)
But that only returns (with the Chrome dev console):
"undefined USD"
str = str.replace(/\d*[,.]?\d+[ \t]*/g, '');replace()would have shown you it takes 2 arguments%.7