From: "JeremyWoertink@..." Date: 2007-10-19T04:20:59+09:00 Subject: Re: array help awesome. So what does the 0..-2 do? how does that work exactly? Thanks for the help ~Jeremy On Oct 18, 12:17 pm, "Thomas Adam" wrote: > Hi -- > > On 18/10/2007, JeremyWoert...@gmail.com wrote: > > > I have [1,2,3] and I want to return [1,2] is there already a method > > that does this? > > > irb(main):001:0> [1,2,3] > > => [1, 2, 3] > > irb(main):002:0> [1,2,3].pop > > => 3 > > irb(main):003:0> [1,2,3].everything_but_the_one_thing_that_pop_returns > > [1,2,3][0..-2] > #=> [1, 2] > > -- Thomas Adam