From: Robert Klemme Date: 2009-04-03T15:29:34+09:00 Subject: Re: An array problem On 03.04.2009 07:09, George George wrote: >> 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 I don't see how the order in a could not be preserved. Please check again oder provide full code. Kind regards robert