top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to remove duplicate characters from String in C#?

+2 votes
301 views
How to remove duplicate characters from String in C#?
posted May 3, 2017 by Madhavi Kumari

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Use this code:

public static string RemoveDuplicates(string input)
{
return new string(input.ToCharArray().Distinct().ToArray());
}

answer May 5, 2017 by Manikandan J
...