From: as Date: 2009-04-30T20:15:31+09:00 Subject: Re: find if an array has any element present in another array Le Thu, 30 Apr 2009 12:57:23 +0200, as a 辿crit : > Le Thu, 30 Apr 2009 05:52:26 -0500, > Charanya Nagarajan a 辿crit : > > > I have 2 lists > > > > a=[1,2,3,4] > > b=[2,4,6,7,8] > > > > I want to find if there are any elements present in "a" which are > > also present in "b". > > I jus wanna "true" or "false" answer if both of the arrays have any > > element in common. > > (a-b).nil? Ouch, sorry, (a&b).empty? -- Arnaud Schmittbuhl