From: Josh Knowles Date: 2006-10-14T07:25:22+09:00 Subject: Re: Sorting through an array of an array ------=_Part_45992_29872774.1160778318272 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 10/13/06, Dominic Son wrote: > > Hello. > > Each of my arrays look like this: > container[0] = ["foo", "bar", "baz"] > container[1] = ["doo", "poo", "woo"] > > i'd like to sort by the second position (bar, and poo) > and of course,affecting the whole row, so that "bar" should be on top, > along with "foo" and "baz" as container[0]. > > What method should i use? container.sort { |row1, row2| row1[1] <=> row2[1] } Josh -- Josh Knowles joshknowles@gmail.com http://joshknowles.com ------=_Part_45992_29872774.1160778318272--