From: "Peda, Allan (NYC-GIS)" Date: 2008-10-12T14:00:15+09:00 Subject: Re: Compare Arrays ------_=_NextPart_001_01C92C27.C436266D Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable You are doing set operations, so I looked there first: require 'set' s1 =3D Set.new [1, 2, 7, 8, 9, 45, 98, 85, 39] =20 s2 =3D Set.new [1, 45, 66, 4, 84, 98 ] p (s1 - s2) | (s2 - s1) -----Original Message----- From: Tj Superfly [mailto:nonstickglue@verizon.net] Sent: Sat 10/11/2008 11:50 PM To: ruby-talk ML Subject: Compare Arrays =20 Hey, I just have a quick question about arrays. I have two different ones that I would like to compare. Example: Array 1: cats, dogs, monkeys Array 2: cats, fish, dogs, birds, monkeys Now, I would like to compare array 2 with array 1 and have it spit out any words that aren't in both... if that makes sense. So what the program should output is fish, monkeys. --=20 Posted via http://www.ruby-forum.com/. This message contains information which may be confidential and privileged. Unless you are the intended recipient (or authorized to receive this message for the intended recipient), you may not use, copy, disseminate or disclose= to anyone the message or any information contained in the message. If you have received the message in error, please advise the sender by reply e-mail, and delete the message. Thank you very much. (A) ------_=_NextPart_001_01C92C27.C436266D--