CODEKILLER

반응형

Linq - Select 기본
Linq - Select 기본

public class Example
{
    public static void Main()
    {
        Console.Write("<< Linq - Select 기본 예제 >> \n");

        List<string> words = new() { "code", "killer", "the", "day" };

        var query = from word in words
                    select word.Substring(0, 1);

        foreach (string s in query)
            Console.WriteLine(s);

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

공유하기

facebook twitter kakaoTalk kakaostory naver band