Remove duplicate characters in a string in C# using Linq

Saratvaddilli
Posted by Saratvaddilli under C# category on | Points: 40 | Views : 2612
  protected void Page_Load(object sender, EventArgs e)
{
VanishDuplicates("RemoveDuplicates");
}



public string VanishDuplicates(string strInput)
{
string strOutPut = new string(strInput.ToCharArray().Distinct().ToArray());
return strOutPut;
}

Comments or Responses

Login to post response