Skip to content

How to add a double quote to a string

2 messages · arunkumar1111, Mario Valle

#
Hi 

I want to add a double quote to a string

eg


Expected output = DROP TABLE  IF EXISTS "abc"

My code

tab=c("abc")
query = paste("DROP TABLE IF EXISTS ",tab,sep="")

Please help me to solve this problem


--
View this message in context: http://r.789695.n4.nabble.com/How-to-add-a-double-quote-to-a-string-tp3893061p3893061.html
Sent from the R help mailing list archive at Nabble.com.
#
On 11-Oct-11 09:23, arunkumar1111 wrote:
query = paste("DROP TABLE IF EXISTS \"",tab,"\"", sep="")

or
query = paste('DROP TABLE IF EXISTS "',tab,'"', sep="")

and tab="abc". no need for c()
  
Ciao!
				mario