box-o-sand/RubyFun/wikibooks-tutorial/strings.rb
Dan Buch 0a9428093c Add 'RubyFun/' from commit 'b01c6826131196ba58b5288a3182f2526c89c249'
git-subtree-dir: RubyFun
git-subtree-mainline: a04a502787
git-subtree-split: b01c682613
2013-01-09 23:50:14 -05:00

20 lines
475 B
Ruby

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!
}