From: Ryan Leavengood Date: 2005-07-16T00:04:53+09:00 Subject: Re: multi-line strings with """ YANAGAWA Kazuhisa said: > > You can use: > > "mere single double-quotation > for multi-line string" > > str = < or use here document > for multi-line string > EOS There is also %q (works like single quotes) and %Q (works like double quotes, i.e. has interpolation): irb(main):009:0> %q{"Look", you can "use" 'all' "the" "quotes" "you" want irb(main):010:0' and "on" multiple "lines" irb(main):011:0' 'yep'} => "\"Look\", you can \"use\" 'all' \"the\" \"quotes\" \"you\" want\nand \"on\" multiple \"lines\"\n'yep'" irb(main):012:0> %Q{"#{1+1}" and 'blah' irb(main):013:0" "foo"} => "\"2\" and 'blah'\n\"foo\"" Ryan