Mid Collections

How do you remove duplicates from a List<T>?

list = list.Distinct().ToList();

For custom objects, override Equals() and GetHashCode().

More from C# Programming Tutorial

All questions for this course