From: dblack@... Date: 2006-11-22T07:53:20+09:00 Subject: Re: array question Hi -- On Wed, 22 Nov 2006, Pete Yandell wrote: > I'm surprised nobody has suggested: > > a.zip(a).flatten[1..-2] I decided to avoid flatten (see my earlier comments). To be flatten-safe, you could do: require 'flattenx' # [1] a.zip(a).flatten_once[1..-2] David [1] http://www.rubypal.com/ruby/flattenx -- David A. Black | dblack@rubypal.com Author of "Ruby for Rails" [1] | Ruby/Rails training & consultancy [3] DABlog (DAB's Weblog) [2] | Co-director, Ruby Central, Inc. [4] [1] http://www.manning.com/black | [3] http://www.rubypowerandlight.com [2] http://dablog.rubypal.com | [4] http://www.rubycentral.org