Distinct returns the input sequence, stripped of duplicates.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
class Program
{
static void Main()
{
char[] distinctLetters = "HelloWorld".Distinct().ToArray();
string s = new string(distinctLetters);
Console.WriteLine(s);
}
}
The output:
HeloWrd
| www_.__j_a___v__a__2_s__._co___m___ | Contact Us |
| Copyright 2009 - 12 Demo Source and Support. All rights reserved. |
| All other trademarks are property of their respective owners. |