Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Replace en- and em-dashes

I'm trying to replace en- and em-dashes by simple dash

dashes <- c("13.9","14.5","—1.7","—3.0","-5.0")
gsub("[-–—]","-", dashes)

but doesn't work unfortunately. I still see "—1.7" and "—3.0" instead of "-1.7" and "-3.0".

Is there anything I'm missing in gsub to achieve desired output?

Comments