[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-talk
Subject:    multi-line strings with """
From:       Navindra Umanee <navindra () cs ! mcgill ! ca>
Date:       2005-07-15 10:11:52
Message-ID: 20050715061147.A28910 () cs ! mcgill ! ca
[Download RAW message or body]

Hi,

Why is it that multi-line strings that begin with """ close themselves
when a single " is encountered?

irb(main):006:0> """
irb(main):007:0" This is a multi-line string
irb(main):008:0" with a "
=> "\nThis is a multi-line string\nwith a "

I find this to be somewhat annoying.  The Python way seems preferable:

>>> """
... In this string I can have isolated "s without worry
... the only way to end the string is with """
'\nIn this string I can have isolated "s without worry\nthe only way to end thestring is with '

Any chance this behavior will change in the next Ruby?  :-)

Thanks,
Navin.



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic