Answers for "remove duplicates in a generic collection c sharp"

C#
1

c# list remove duplicate items

List<string> lstWhitDuplicate = new list<string>();
lstWhitDuplicate.add("hallo");
lstWhitDuplicate.add("hallo");
lstWhitDuplicate.add("World");

List<string> lst = lstWhitDuplicate.Distinct().ToList(); 

// output lstWhitDuplicate:
// hallo hallo world
// output lst:
// hallo word
Posted by: Guest on August-14-2021
0

c# list remove item based on property duplicate

fooArray.GroupBy(x => x.Id).Select(x => x.First());
Posted by: Guest on May-09-2020

C# Answers by Framework

Browse Popular Code Answers by Language