From: Lex Williams Date: 2008-09-08T16:48:16+09:00 Subject: Re: Sort date array without using ruby's built-in date class Robert Marley wrote: > Say for instance I have an array of dates in string format > > dates = ['06/12/08', '11/11/06', '01/01/07'] > > I want to sort this array in ascending order without using Ruby's > built-in date class. Is there a way of doing this? > > Just started Ruby and I'm pretty much a newbie. I tried the sort!, but > it sorts only by day. > > Thanks > Rob you should split each string on / and then make the comparisons , in this order : year , month , day -- Posted via http://www.ruby-forum.com/.