If I give input in a textbox like
AaBbcdCDEb
the output should be
ABCDE or abcde
only unique characters should be present, no duplicate characters.
How to do it?
Use the Distinct extention method on the character array and then recompile them to a string.
new string("AaBbcdCDEb".ToLower().Distinct().ToArray());
string input = "AABBCCDD"; string output = string.empty; foreach(char c in input) if (!output.Contains(c)) output += c;
foreach char in textbox if textbox / newline contains char then return, else add on newline?