Subject: Re: find if an array has any element present in another arra
From: 7stud -- <bbxx789_05ss yahoo.com>
Date: Thu, 30 Apr 2009 20:14:56 +0900
References: 335513335515
In-reply-to: 335515
as wrote:
>
> (a-b).nil?
result = [1] - [2, 3] #no common elements
p result
result = [2, 3] - [2] #common elements
p result
--output:--
[1]
[3]
--
Posted via http://www.ruby-forum.com/.