0

Compare the two and just return how many match, don't need to know which ones matched

Having a bit of brain freeze on this right now, any got any ideas?

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by Mitja Bonca
1

Use Linq:

string[] a = { "a", "b", "c" };
string[] b = { "b", "c", "d" };
string[] c = a.Intersect(b).ToArray();

Array c has values "b" and "c".

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.