From: Jay Levitt Date: 2007-09-28T01:50:08+09:00 Subject: Re: Detecting number ranges On Wed, 26 Sep 2007 17:18:58 +0900, Jes�s Gabriel y Gal�n wrote: > db.sort.each_cons(2) {|x, y| if y == x + 1 then result.last << y; > else result << [y]; end} Nice! I think this is the magic I was looking for. -- Jay Levitt | Boston, MA | My character doesn't like it when they Faster: jay at jay dot fm | cry or shout or hit. http://www.jay.fm | - Kristoffer