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

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
Who is Participating?

Improve company productivity with a Business Account.Sign Up

käµfm³d 👽Connect With a Mentor Commented:
If you can use LINQ, then it trivially becomes:

Imports System.Linq


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

Open in new window

PNRTAuthor Commented:
Hi Thanks for the fast reply.   Is "second" the second array?   Does result become an array?
käµfm³d 👽Commented:
Yes, and yes. It will be a third array, though.
PNRTAuthor Commented:
Sounds perfect.  Thanks. I'll run it
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.