Michael Guterl
10/6/2008 3:46:00 PM
On Mon, Oct 6, 2008 at 11:29 AM, Jack Smith <js@priceline.com> 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