扩展方法

 1  public static class se
 2     {
 3         public static string getHello(this string s)
 4         {
 5             return "linq给我了一个扩张方法";
 6         }
 7     }
 8 
 9     class Program
10     {
11         
12         static void Main(string[] args)
13         {
14             string s = "";
15             Console.WriteLine(s.getHello());
16             Console.Read();       
17 
18             
19     }
20 }    

 

posted @ 2016-02-20 20:22  ChineseMoonGod  阅读(132)  评论(0编辑  收藏  举报