From: Rick DeNatale Date: 2007-03-27T07:53:02+09:00 Subject: Re: adding anotehr each method to String On 3/25/07, Une B�vue wrote: > Une B�vue wrote: > > > > > exists allready ? > > Yes, following : > > ms=String.methods > puts ms.include?('to_a') > > > however : > 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\nto".each {|l| puts l} to to -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/