From: George George Date: 2009-04-03T14:09:27+09:00 Subject: Re: An array problem > > You want #include? instead of #detect: > > a.each do |el| > case > when b.include? el > puts "#{el} -b" > when c.include? el > puts "#{el} -c" > end > end Thanks a lot Robert, However this solution does not seem to preserve the order in of array a. for example if array a contained a = ["x","y","z","f"] b = ["y","z"] c = ["x","f"] the result should be x-c y-b z-b f-c Thanks GG -- Posted via http://www.ruby-forum.com/.