初识LINQ表达式

 

using  System;
using  System.Collections.Generic;
using  System.Linq;
class  app
{
    
static   void  Main()
    {
        
string [] names  =  {  " Burke " " Connor " " Frank " " Everett " " Albert " " George " " Harris " " David "  };
        IEnumerable
< string >  query  =  from s  in  names
                                    
where  s.Length  ==   5
                                    orderby s
                                    select s.ToUpper();
        
foreach  ( string  item  in  query)
            Console.WriteLine(item);
    }
}

你可能感兴趣的:(C#3.0)