From: Karuppasamy M Date: 2011-03-03T15:25:12+09:00 Subject: Re: Anything like Array.contains? method --00163630f443623372049d8e17c0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Returns the index of the first object in *self* such that is =3D=3D to *obj= *. Returns nil if no match is found. a =3D [ "a", "b", "c" ] a.index("b") #=3D> 1 a.index("z") #=3D> nil M. Karuppasamy On Thu, Mar 3, 2011 at 11:49 AM, =E5=B1=8B=E5=9B=BD=E9=81=A5 wrote: > 2011/3/3 Paul Sholtz : > > Is there a method in the Ruby array object that gives anything like a > > "contains?" method, to test if an object is already in the Array? > > How about include? > -- > Haruka YAGNI > hyagni@gmail.com > > --00163630f443623372049d8e17c0--