From: "David A. Black" Date: 2008-07-16T22:43:45+09:00 Subject: Re: Array.drop doesn't work Hi -- On Wed, 16 Jul 2008, Frederick Cheung wrote: > > On 15 Jul 2008, at 16:46, Li Chen wrote: > >> Hi all, >> >> I try to use #drop to remove several elements from an array but it >> doesn't work. >> I check "ri Array.drop" and get no info about #drop. But I see this info >> described in http://www.ruby-doc.org/core/classes/Array.html#M000343 >> >> >> ary.drop(n) => array >> >> Drops first n elements from ary, and returns rest elements in an array. >> >> a = [1, 2, 3, 4, 5, 0] >> a.drop(3) # => [4, 5, 0] >> >> >> > Seems like this was added in 1.8.7 (if you look at the docs for 1.8.6 you'll > see it's not there) It's a backport from 1.9. I think that's mostly what 1.8.7 is. It's really kind of 1.9.prev, rather than 1.8.6.succ :-) (though of course it doesn't have YARV, etc.) David -- Rails training from David A. Black and Ruby Power and Light: Intro to Ruby on Rails July 21-24 Edison, NJ Advancing With Rails August 18-21 Edison, NJ See http://www.rubypal.com for details and updates!