[c#/Linq] Linq Let 절 사용하기


[c#/Linq] Linq Let 절 사용하기

사용설명 - 그 자체를 쿼리할 수 있는 열거 가능한 형식을 만듭니다. - 여러 Collection들을 관리하거나 접근할때 유용하게 사용됩니다. Linq Let 사용예제 string[] strings = { "The codekiller catches the bug.", }; var earlyBirdQuery = from sentence in strings // let절을 이용하여 ' '로 구분된 string 배열을 관리합니다. let words = sentence.Split(' ') from word in words // let절을 이용하여 word를 소문자 처리를 합니다. let w = word.ToLower() where w[0] == 'a' || w[0] == 'e' select word; 결과 - ..


원문링크 : [c#/Linq] Linq Let 절 사용하기