From: Daniel N Date: 2006-11-21T13:45:29+09:00 Subject: Re: array question ------=_Part_13877_14852879.1164084325913 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 11/21/06, Wilson Bilkovich wrote: > > > > > > A couple of ways: (there are probably dozens more) > # given: > array = [1,2,3,4,5,6] > > # 1. > new_array = array[1..-2] This would not duplicate the inner elements though. To build on this one. b = a.inject( [] ) { |a,e| a << [e,e]}.flatten[1..-2] This looks pretty jarring to my eyes though :( ------=_Part_13877_14852879.1164084325913--