To remove duplicates from a list in C# we can use the Distinct function:
List<string> ListwithoutDuplicates = ListwithDuplicates.Distinct().ToList();
The list ListwithoutDuplicates will be free of all duplicate values present in the original list.
To remove duplicates from a list in C# we can use the Distinct function:
List<string> ListwithoutDuplicates = ListwithDuplicates.Distinct().ToList();
The list ListwithoutDuplicates will be free of all duplicate values present in the original list.