From: Tachikoma Date: 2008-07-16T11:25:29+09:00 Subject: Re: Array.drop doesn't work On Jul 15, 11:46 pm, 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 inhttp://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] > > I wonder what is going on. > > Thank you very much, > > Li > ######### > C:\Documents and Settings\chen73>irb > irb(main):001:0> a=[1,2,3,4] > => [1, 2, 3, 4] > irb(main):002:0> a.class > => Array > irb(main):003:0> a.drop(1) > NoMethodError: undefined method `drop' for [1, 2, 3, 4]:Array >         from (irb):3 > irb(main):004:0> a.drop(2) > NoMethodError: undefined method `drop' for [1, 2, 3, 4]:Array >         from (irb):4 > irb(main):005:0> > > ######### > C:\Documents and Settings\chen73>ri Array.drop > Nothing known about Array.drop > -- > Posted viahttp://www.ruby-forum.com/. Here is the Changes List ,and Array#drop included http://svn.ruby-lang.org/repos/ruby/tags/v1_8_7/NEWS