CODEKILLER

반응형

Distinct 출력.
Distinct 출력.

using System.Xml.Linq;

public class Example
{
    public static void Main()
    {
        Console.Write("<< Distinct 예제 >> \n");

        string[] words = { "this", "code", "killer", "killer", "code", "funny" };
        
        IEnumerable<string> query = from planet in words.Distinct()
                                    select planet;

        foreach (var str in query)
        {
            Console.WriteLine(str);
        }

        Console.WriteLine(System.Environment.NewLine);
        Console.WriteLine("Press any key to exit");
        Console.ReadKey();
    }
}
반응형

공유하기

facebook twitter kakaoTalk kakaostory naver band