Hello

 

 1 using System;
 2 using System.Linq;
 3 using System.Collections.Generic;
 4 
 5 class app
 6 {
 7     static void Main()
 8     {
 9         string[] names = { "Burke""Connor""Frank"
10                        "Everett""Albert""George"
11                        "Harris""David" };
12 
13         IEnumerable<string> expr = from s in names
14                                    where s.Length == 5
15                                    orderby s
16                                    select s.ToUpper();
17 
18         IEnumerable<string> lsit = from s in names
19                                    where s.Equals("Frank")
20                                    select s.ToString();
21 
22         foreach (string item in expr)
23             Console.WriteLine(item);
24 
25 
26         Console.WriteLine(lsit.ToList<string>()[0]);
27 
28         Console.ReadLine();
29     }
30 }
31 
posted @ 2007-05-31 11:48  KidYang  阅读(204)  评论(0编辑  收藏  举报