[C#/Linq] 문자열 필터링 예제


[C#/Linq] 문자열 필터링 예제

public class Example { public static void Main() { Console.Write("> \n"); string[] words = { "this", "that", "code", "dog", "cat" }; IEnumerable 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(); } }


원문링크 : [C#/Linq] 문자열 필터링 예제