Solved

VB.Net.  Compare two arrays.  Remove those that are duplicated

Posted on 2013-06-05
4
388 Views
Last Modified: 2013-06-05
Hi Experts.   I have two string arrays.   The first is about 1000 the second about 400.   I need to remove from the second array any item that is in the first array.   So I end up with a list of items that are not in the first array.  Any help appreciated.  Many Thanks
0
Comment
Question by:PNRT
  • 2
  • 2
4 Comments
 
LVL 74

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 39223285
If you can use LINQ, then it trivially becomes:

Imports System.Linq

...

Dim result = second.Except(firstArray).ToArray()

Open in new window

0
 
LVL 1

Author Comment

by:PNRT
ID: 39223296
Hi Thanks for the fast reply.   Is "second" the second array?   Does result become an array?
0
 
LVL 74

Expert Comment

by:käµfm³d 👽
ID: 39223302
Yes, and yes. It will be a third array, though.
0
 
LVL 1

Author Comment

by:PNRT
ID: 39223309
Sounds perfect.  Thanks. I'll run it
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now