CODEKILLER

반응형

Linq- Except 출력.
Linq- Except 출력.

using System.Xml.Linq;

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

        string[] developer1 = { "CodeKiller", "CodeZero", "CodeJenifer", "CodeCapture" };
        string[] developer2 = { "CodeKiller", "CodeJenifer", "CodeBeta", "CodeCapture" };

        IEnumerable<string> query = from developer in developer1.Except(developer2)
                                    select developer;

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

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

public class Car
{
    public int CarCode { get; set; }
    public int CarType { get; set; }
}
반응형

공유하기

facebook twitter kakaoTalk kakaostory naver band