From: Joel VanderWerf Date: 2005-08-02T03:06:16+09:00 Subject: Re: array in array, like include? Joe Cheng wrote: > Ben wrote: > >> Is there a function to checking to see if the elements of one array >> exist in another? >> >> a = [1,2,3,4,5] >> b = [1,4] >> >> a.include?(b) will only work if b is a string. I'd like to get a >> true/false if b exists in a. >> >> > How about: > (a & b).length == b.length (a&[1,4,4]).length == [1,4,4].length => false so it might or might not be ok... -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407