Skip to content
Prev 320409 / 398506 Next

find and replace characters in a string

Hello,

The period is a metacharacter so you have to escape it.
The period is escaped with a '\'. In it's turn, '\' is a metacharacter 
so it needs to be escaped. Hence the double'\\'.

x <- "LOI ."
gsub("\\.", "(%)", x)


Hope this helps,

Rui Barradas

Em 27-03-2013 16:09, Shane Carey escreveu: