From: James Edward Gray II Date: 2007-02-02T03:41:57+09:00 Subject: Re: skim Array two by two On Feb 1, 2007, at 12:26 PM, Mickael Faivre-Macon wrote: > Is it possible to get 2 elements at once ? > I'd like to get > > 1 > 2 > x > 3 > 4 > x >> require "enumerator" => true >> [1, 2, 3, 4].each_slice(2) { |a, b| puts a, b, "x" } 1 2 x 3 4 x => nil Hope that helps. James Edward Gray II