I'm trying to remove a pound sign (£) from a string using javascript. I'm trying to do it using
str = str.replace(/\£/g, "");
However, it is not removing the sign.
The value of str is being fetched from a span (and the correct value is being fetched). This span has been previously set using javascript, with it being encoded in the string as
£
Any ideas on the best way to remove the pound sign?
Inserting the pound symbol using an Alt keyboard shortcutPress and hold Alt + 0163 or Alt + 156 on the numeric keypad.
The pound symbol (#), also known by many other names that include pound sign, number sign, hash mark, and hashtag, is a typographical symbol that is rarely used in formal writing. However, this symbol is used often in informal writing, specifically on social media.
In the Unicode standard, the symbol £ is called POUND SIGN, and the symbol ₤ is the LIRA SIGN.
You may need to use unicode for this. E.g., '£10.00'.replace(/\u00A3/g, '');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With