How to Remove Duplicates from a C# List
To remove duplicates from a C# list using Linq, do the following. Define a new list. Ours has 7 elements, with “2” and “4” repeating Use Distinct().ToList() to make a new list with the distinct elements Print out to the console This outputs: