From: "JeremyWoertink@..." Date: 2007-10-19T04:17:54+09:00 Subject: Re: array help well I guess 2 solutions would be either [1,2,2] - [1,2,3].pop.to_a which just seems really ugly and not rubyish at all. then I guess I could do [1,2,3].first(2) as long as my array stays constant, but if it changes, then i'm screwed. Any other ideas? On Oct 18, 12:05 pm, "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 > > ~Jeremy