Reputation: 1108
I have a string which is sometimes £10.00 and sometimes ££10.00, this is dynamic. is there a way to remove one of the £ signs from the string if more than one exists?
Upvotes: 0
Views: 40
Reputation: 352
You may need to replace if is more then one, so you may do somting like @mplungjan told:
str = '££££££10.000'
str2 = str.replace(/£+/g, "£")
console.log(str2)
Upvotes: 1