Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2013-06-05
4
Medium Priority
?
414 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

670 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