Answers for "remove duplicate values from string array in c#"

C#
2

remove duplicate characters in a string C#

public static string RemoveDuplicates(string input)
{
    return new string(input.ToCharArray().Distinct().ToArray());
}
Posted by: Guest on February-25-2021
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

Code answers related to "remove duplicate values from string array in c#"

C# Answers by Framework

Browse Popular Code Answers by Language