From: Robert Dober Date: 2006-11-09T21:36:45+09:00 Subject: Re: thousand ways to rome ------=_Part_49809_33178021.1163075803269 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 11/9/06, spooq wrote: > > use map! instead nope, try to understand the difference between split(regexp), map and map! than decide for yourself Look at this for example "he, nice, guys".split(',').map!{|x| x.strip} why would you use map! ? try to put the above expression into a context e.g. x = ... Hint: using map! on unreferenced objects is quite useless. What about x= "he, nice".split(",") x.map!{|x|x.strip} try x.map!{|x|x.strip!} would you like to use this? If you want to walk do not learn to drive ;) Cheers Robert On 11/9/06, Chris Mueller wrote: > > good timing to you first two guys;) > > > > thx very much. got some new ruby cells working in my brain. > > > > i tried same thing as ".map" with "array.each" before, but this does > > only apply on a copy i suppose... > > > > and of course the regexp way is ... groovy! > > > > -- > > Posted via http://www.ruby-forum.com/. > > > > > > -- The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. - George Bernard Shaw ------=_Part_49809_33178021.1163075803269--