C# 编写简单的LINQ to Objects查询

// 编写简单的LINQ to Objects查询 // LinqtoObjects.cs using  System; using  System.Text; using  System.Linq; using  System.Collections.Generic; namespace  Ch19 {      class   LinqToObjects     {          static   void  Main( string [] args)         {              string [] names = { "James Huddleston"  ,  "Pearly" "Ami Knox" "Rupali Agarwal"                             ,  "Beth Christmas"  ,  "Fabio Claudio" "Vamika Agarwal"                             ,  "Vidya Vrat Agarwal"  };              IEnumerable  < string > emp =  from  name  in  names                                        where  name.Length <= 16                                        select  name;              foreach  ( var  name  in  emp)             {                  Console .WriteLine(name);             }              Console .ReadLine();         }     } } ---------------- James Huddleston Pearly Ami Knox Rupali Agarwal Beth Christmas Fabio Claudio Vamika Agarwal

来自为知笔记(Wiz)

转载于:.html

C# 编写简单的LINQ to Objects查询

// 编写简单的LINQ to Objects查询 // LinqtoObjects.cs using  System; using  System.Text; using  System.Linq; using  System.Collections.Generic; namespace  Ch19 {      class   LinqToObjects     {          static   void  Main( string [] args)         {              string [] names = { "James Huddleston"  ,  "Pearly" "Ami Knox" "Rupali Agarwal"                             ,  "Beth Christmas"  ,  "Fabio Claudio" "Vamika Agarwal"                             ,  "Vidya Vrat Agarwal"  };              IEnumerable  < string > emp =  from  name  in  names                                        where  name.Length <= 16                                        select  name;              foreach  ( var  name  in  emp)             {                  Console .WriteLine(name);             }              Console .ReadLine();         }     } } ---------------- James Huddleston Pearly Ami Knox Rupali Agarwal Beth Christmas Fabio Claudio Vamika Agarwal

来自为知笔记(Wiz)

转载于:.html