On Nov 27, 2013, at 7:42 AM, Joshua P. [email protected] wrote:
I’m learning to program and I want to insert the user response to a
question but put " " around it. Like this:
Gets = reply
Puts “WHAT DO YOU MEAN " + “reply.upcase” + " YOU ARE FIRED!!”
any ideas how to escape " without using string interpolation? I’m
reading a book that hasn’t introduced interpolation yet so want to keep
(I’m not sure what has been introduced in the book yet, so these
questions might not be appropriate!)
Do you know about single quotes for strings yet?
puts ‘Here is a double quote: "’
Do you know about how \ can be used to escape characters or introduce
“special” characters in a string literal?
puts "Here is a double quote: “”
Hope this helps,
Mike S. [email protected]
The “`Stok’ disclaimers” apply.