How compare 2 string arrays with duplicate records

  • Thread starter Thread starter Learning Rocks
  • Start date Start date
L

Learning Rocks

Guest
I have 2 string arrays for example

string[] a = {"The","Big", "Ant", "The"};
string[] b = {"Big","Ant","Ran"};

here i am comparing 2 string arrays(a may contains duplicate elements as well). How to get not matched elements while comparing a and b in b(with duplicates as well). in linq 'Except' i am not getting duplicate records. I need to get duplicates as well.

b = a.Except(b).ToArray();

Thanks

Continue reading...
 
Back
Top