첫걸음

string[] names = { "Tom", "Dick", "Harray" };
string[] names = { "Tom", "Dick", "Harray" };
IEnumerable<string> filteredNames = System.Linq.Enumerable.Where(names, n => n.Length >= 4)

foreach (int n in filteredNames)
  Console.Write(n);  // Dick Harry
string[] names = { "Tom", "Dick", "Harray" };
IEnumerable<string> filteredNames = names.Where(names, n => n.Length >= 4)

foreach (int n in filteredNames)
  Console.Write(n);  // Dick Harry
string[] names = { "Tom", "Dick", "Harray" };
IEnumerable<string> filteredNames = from n in names
                                    where n.Contains("a")
                                    select n;

유창한 구문

질의 연산자 연쇄

string[] names = { "Tom", "Dick", "Harray", "Mary", "Jay" };
IEnumerable<string> query = names.Where(n => n.Contain("a")).OrderBy(n => n.Length).Select(n => n.ToUpper());

foreach (string name in query)
  Console.Write(name);  // JAY MARY HARRY