From: Victor Reyes Date: 2007-11-23T23:13:15+09:00 Subject: Re: Two arrays: return only values that exist in both arrays? ------=_Part_14646_28759639.1195827194422 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Thank you On Nov 23, 2007 8:26 AM, Garret Kelly wrote: > You're looking for "a - b", in that case. > > http://ruby-doc.org/core/classes/Array.html > > Hope that helps. > > On Nov 23, 2007 8:06 AM, Victor Reyes wrote: > > How about the elements that are in one but not the other array? > > > > Where are these methods documented? > > > > Thank you > > > > Victor > > > > > > On Nov 23, 2007 7:55 AM, Dejan Dimic wrote: > > > > > On Nov 23, 1:25 pm, Joshua Muheim wrote: > > > > Hi all > > > > > > > > a = [:one, :two, :three, :six] > > > > b = [:two, :four, :five: six] > > > > > > > > I want to extract the values of two arrays which exist in both ones > (a > > > > and b): > > > > > > > > # => [:two, :six] > > > > > > > > Does there exist a method for this? > > > > > > > > Thanks > > > > Josh > > > > -- > > > > Posted viahttp://www.ruby-forum.com/. > > > > > > Try > > > a&b > > > > > > Dima :-) > > > > > > > > > > ------=_Part_14646_28759639.1195827194422--