Compare Items in Two Arrays

G

Gabe Matteson

How would I compare two arrays and find if anything in Array 1 exists in
Array 2 or visvera? Thank you.
 
A

Armin Zingler

Gabe Matteson said:
How would I compare two arrays and find if anything in Array 1
exists in Array 2 or visvera? Thank you.


Write two loops and search for each item in the other array. In VB 2008,
you can make use of the 'Contains' extension method (eg
Array1.Contains(value))


Armin
 
K

kimiraikkonen

Write two loops and search for each item in the other array. In VB 2008,
you can make use of the 'Contains' extension method (eg
Array1.Contains(value))

Armin

In VB2005 there are "exists" and "find(and its derivations)" functions
but usage may depend on array.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Compare large arrays 3
Compare Arrays 8
sort two arrays as one? 7
Compare Datasets or Arrays 4
Compare arrays 1
vba array logic 3
array as object problem 7
Looping through files to compare 6

Top