From: Re BR Date: 2009-09-17T02:50:54+09:00 Subject: Re: string to array John W Higgins wrote: > On Wed, Sep 16, 2009 at 9:20 AM, John W Higgins > wrote: > >> > >> x = "apple-orange-grape" >> tmp = x.split('-') >> (0..tmp.length-1).map{ |i| e[i..-1].join('-') } >> > > Sorry that should be > > (0..tmp.length-1).map{ |i| tmp[i..-1].join('-') } > > John trying to make this as a one liner a.split('.').map{ |i| a[i..-1].join('.') } but I am missing something -- Posted via http://www.ruby-forum.com/.