From: Michael Guterl Date: 2008-10-07T00:46:19+09:00 Subject: Re: Printing varible with quotes around it On Mon, Oct 6, 2008 at 11:29 AM, Jack Smith wrote: > I am trying to print my variable in a puts statment but add quotes > around it. > > This works but does not put quotes around my text: > z = "This is my text" > puts z > > I have tried > > puts %Q!z! > and > puts '"#{z}"' > > but I can't seem to get my text to print out like: > > "This is my text" > You need to escape the " with \. puts "\"This is my text\"" HTH, Michael Guterl