// LinqtoObjects.cs
using
System;
using
System.Text;
using
System.Linq;
using
System.Collections.Generic;
namespace
Ch19
{
class
LinqToObjects
{
static
void
Main(
string
[] args)
{
string
[] names = {
"James Huddleston"
,
"Pearly"
,
"Ami Knox"
,
"Rupali Agarwal"
,
"Beth Christmas"
,
"Fabio Claudio"
,
"Vamika Agarwal"
,
"Vidya Vrat Agarwal"
};
IEnumerable
<
string
> emp =
from
name
in
names
where
name.Length <= 16
select
name;
foreach
(
var
name
in
emp)
{
Console
.WriteLine(name);
}
Console
.ReadLine();
}
}
}
----------------
James Huddleston
Pearly
Ami Knox
Rupali Agarwal
Beth Christmas
Fabio Claudio
Vamika Agarwal