using System;
using System.Collections.Generic;
using System.Linq;

namespace LinqDemoWhere
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] names = { "Tom", "Dick", "Harry" };
            IEnumerable<string> filteredNames = names.Where(n => n.Length >= 4);
            foreach (string name in filteredNames)
                Console.WriteLine(name);

            IEnumerable<string> filteredNamesTwo = from n in names
                                                   where (n.Length >= 4)
                                                   select n;
            foreach (string name in filteredNamesTwo)
                Console.WriteLine(name);
            Console.ReadKey();
        }
    }
}
