using System;
using System.Text;
using System.Linq;
using System.Collections.Generic;
class LinqToObjects
{
static void Main(string[] args)
{
string[] names = { "test", "test 1", "Am" };
IEnumerable<string> namesOfPeople = from name in names where name.Length <= 2 select name;
foreach (var name in namesOfPeople)
Console.WriteLine(name);
}
}
|