A Simple LinqToObjects Snippet

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace LinqToObjects
{
    class LinqToObjects
    {
        static void Main(string[] args)
        {
            string[] names = { "James Huddleston", "Pearly", "Ami Know", "Rupli Agarwal", "Beth Christams", "Fabio Claudio", "Vamika Agarwal", "Vidya Varat Agrawaaaa"};
            IEnumerable<string> namesOfPeople =             
                from name in names
                where name.Length >9
                select name;
            foreach (var name in namesOfPeople)
            {
                Console.WriteLine(name);
            }
        }
    }
}

Leave a Reply

Your email address will not be published. Required fields are marked *