CODEKILLER

반응형

Linq - 필터링 예제 출력.
Linq - 필터링 예제 출력.

public class Example
{
    public static void Main()
    {
        Console.Write("<< Linq - 필터링 예제 >> \n");

        string[] words = { "this", "that", "code", "dog", "cat" };

        IEnumerable<string> query = from word in words
                                    where word.Length == 3
                                    select word;

        foreach (string 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