Remove double quote /” symbol from string

  • A+

I need to remove /" from a vector. This is my data:

data <- c("/"*PWc&offerid=323058.1803224&type=2&",  "/"*PWc&offerid=323058.1848638&type=2&",  "/"*PWc&offerid=323058.1426684&type=2&",  "/"*PWc&offerid=323058.1628300&type=2&",  "/"*PWc&offerid=323058.1615700&type=2&",  "/"*PWc&offerid=323058.809770&type=2&",  "/"*PWc&offerid=323058.574388&type=2&",  "/"*PWc&offerid=323058.1436610&type=2&",  "/"*PWc&offerid=323058.1771266&type=2&",  "/"*PWc&offerid=323058.1734052&type=2&" ) 

As you can see, every object starts with /". How can I specifically remove these characters and leave the links?


You can try this. Note that what you actually want is to remove /", not "/ (as proposed in the unedited version of your question). The first " you need to represent each element in the character.

gsub('[/"]', '', data) 


:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: