Answers for "c# linq remove consequent duplicates in list"

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# linq remove duplicate items from list of integer

List<int> distinct = list.Distinct().ToList();
Posted by: Guest on January-29-2021

C# Answers by Framework

Browse Popular Code Answers by Language