From: Charles Lowe Date: 2007-05-03T22:50:45+09:00 Subject: Re: array slicing Harry Kakueki wrote: > On 5/3/07, Pe�a, Botp wrote: >> >> >> > > Thanks for sort_by. > I didn't know that. > > Harry Just using sort won't get the results into nested arrays based on the groupings. For this, you need group_by: anArray.group_by { |a| a[1..2] }.sort.transpose[1] -- Posted via http://www.ruby-forum.com/.