Skip to content
Prev 68045 / 398506 Next

Printing a single "\" character

On Tue, 19 Apr 2005, Firas Swidan wrote:

            
Use cat("\\").
Use
   sub("_","\\\\_","g_g")

If you print() the result it will look as though it has a double \, but 
that's an optical illusion. cat() will show it correctly with a single \ 
(and nchar() will confirm that it has 4 characters).

 	-thomas