From: Rick DeNatale Date: 2007-03-28T01:29:42+09:00 Subject: Re: adding anotehr each method to String On 3/26/07, Phrogz wrote: > On Mar 26, 4:53 pm, "Rick DeNatale" wrote: > > On 3/25/07, Une B�vue wrote: > > > s='toto' > > > s.to_a > > > # => ['toto'] > > > > This is because in Ruby a String doesn't act as a collection of > > characters, it acts as a collection of lines. > > > > s = "to\nto" > > s.to_a => ["to\n", "to"] > > To be pedantic, it's not really a collection of lines. It's a > collection of stuff-terminated-by-some-arbitrary-character-sequence. > The global variable $/ holds this special string I think that a better name for "stuff-terminated-by-some-arbitrary-character-sequence" would be record. At least the 'english' library seems to think so since it aliases $RS and $INPUT_RECORD_SEPARATOR to $/ -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/