.NET Daily

Recommended Resources


Popular Content


Navigation
Tagcompare arrays
Featured

C#

How to compare two list of items in C#

Posted on January 5th, 2012.

If you want to compare two list of items in C# you can’t just use the equal sign or a loop through elements, you should use Enumerable.SequenceEqual method. For example: List list1 = new List(); list1.Add(7); list1.Add(5); list1.Add(9); List list2 = new List(); list2.Add(7); list2.Add(5); list2.Add(9); if...