On Tue, Jul 19, 2011 at 12:14 PM, I=F1aki Baz Castillo <ibc / aliax.net> wrot=
e:
> Hi, is there a way to generate a new array with the common elements in
> array A and arra B? This is:
>
> =A0arrayA =3D ["qqq", "www", "eee"]
> =A0arrayB =3D ["www", "eee", "rrr", "ttt"]
>
> the result should be: =A0["www", "eee"]

ruby-1.8.7-p334 :001 > arrayA =3D ["qqq", "www", "eee"]
 =3D> ["qqq", "www", "eee"]
ruby-1.8.7-p334 :002 >  arrayB =3D ["www", "eee", "rrr", "ttt"]
 =3D> ["www", "eee", "rrr", "ttt"]
ruby-1.8.7-p334 :003 > arrayA & arrayB
 =3D> ["www", "eee"]

Jesus.