If I give the input from Text Box like
AaBbcdCDEb
the output should be
ABCDE or abcde
only unique characters should be there, no repeated characters.
How do I do this?
If I give the input from Text Box like
AaBbcdCDEb
the output should be
ABCDE or abcde
only unique characters should be there, no repeated characters.
How do I do this?
Use the Distinct extention method on the array of characters then recombine them into a string.
new string("AaBbcdCDEb".ToLower().Distinct().ToArray());
foreach char in textbox, if textbox/new string contains char then return, else add to new string?
string input = "AABBCCDD";
string output = string.empty;
foreach(char c in input)
if (!output.Contains(c))
output += c;