日期:2014-05-20 浏览次数:20814 次
string[] name =new string[1000];
for (int i = 0; i < 1000; i++)
{
name[i] = i.ToString();
}
Stopwatch stopwatch = new Stopwatch();
stopwatch.Start();
IEnumerable<string> storName = from n in name
where (n.Length == (from n1 in name
orderby n1.Length
select n1.Length).First()
)
select n;
foreach (string s in storName)
{
Console.WriteLine(s);
}
stopwatch.Stop();
Console.WriteLine(stopwatch.Elapsed);
Console.ReadLine();