From a333293919285e16aa7f24a3968351f0a41d6aba Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Mon, 3 Jan 2011 13:52:24 -0500 Subject: [PATCH] more fun with strings, alternate quoting, multiline and all that --- wikibooks-tutorial/strings.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/wikibooks-tutorial/strings.rb b/wikibooks-tutorial/strings.rb index 1970f2b..be87edb 100644 --- a/wikibooks-tutorial/strings.rb +++ b/wikibooks-tutorial/strings.rb @@ -1,3 +1,19 @@ print "Enter name: " name = gets.chomp puts "Your name is #{name}" + + +adjective = "dusty" + +puts %q{These runes are "#{adjective}," wouldn't you say?} +puts %Q{These runes are "#{adjective}," wouldn't you say?} + + +puts %Q{Math isn't exactly my "strong suit," what with 2 + 1 being #{2 + 2}} + +puts %Q{ + Perhaps a multiline alternate quoting is of your liking, #{name}? + One in which 'single' and "double" quotes are both safe without + #{adjective} quoting? Smashing! + +}