I have a code like
string code = \"AABBDDCCRRFF\";
In this code, I want to retrieve only distinct characters
The Output should be l
Just for the hell of it - using a StringBuilder
StringBuilder
string code = "AABBDDCCRRFF"; StringBuilder sb = new StringBuilder(); code.Distinct().ToList().ForEach(c => sb.Append(c)); MessageBox.Show(sb.ToString());