Microsoft Forum
Thursday, September 19, 2013
how to remove duplicates in string
Try this:
var testString = "MMdYYYY";
var duplicateValues = testString.Where(character => testString.Count(c => c == character) > 1);
var finalOutputString = new string(testString.Except(duplicateValues).ToArray());
Regards
AJ
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment