Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2013-06-05
4
Medium Priority
?
419 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 75

Accepted Solution

by:
käµfm³d   👽 earned 2000 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 2

Author Comment

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

Expert Comment

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

Author Comment

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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

783 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