Solved

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

Posted on 2013-06-05
4
401 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 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 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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

751 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