From: emarkp@... (E. Mark Ping) Date: 2006-10-14T07:35:20+09:00 Subject: Re: Sorting through an array of an array In article <1a701a2f74c6f4245c0092667a764972@ruby-forum.com>, 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 { |x,y| x[1]<=>y[1] } -- Mark Ping emarkp@soda.CSUA.Berkeley.EDU