欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

linq的使用

程序员文章站 2022-07-04 10:20:18
...
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/archive/2011/05/05/2038251.html