From: "Jesús Gabriel y Galán" Date: 2011-07-19T19:19:35+09:00 Subject: Re: Get common entries in two arrays On Tue, Jul 19, 2011 at 12:14 PM, Iñaki Baz Castillo wrote: > Hi, is there a way to generate a new array with the common elements in > array A and arra B? This is: > >  arrayA = ["qqq", "www", "eee"] >  arrayB = ["www", "eee", "rrr", "ttt"] > > the result should be:  ["www", "eee"] ruby-1.8.7-p334 :001 > arrayA = ["qqq", "www", "eee"] => ["qqq", "www", "eee"] ruby-1.8.7-p334 :002 > arrayB = ["www", "eee", "rrr", "ttt"] => ["www", "eee", "rrr", "ttt"] ruby-1.8.7-p334 :003 > arrayA & arrayB => ["www", "eee"] Jesus.