linq的使用

using System;
using System.Linq;
using System.Collections.Generic;

class Exapmple1_1
{
    static void Main()
    {
        string[] names={"Burke","Connor","Frank",
            "Everett","Albert","George"};      
        IEnumerable<string> expr = from s in names
                                   where s.Length == 5
                                   orderby s
                                   select s.ToUpper();
        foreach (string item in expr)
        {
            Console.WriteLine(item);
        }
        string s1 = Console.ReadLine();
    }
}
原文地址:https://www.cnblogs.com/djcsch2001/p/2038251.html