手机
当前位置:查字典教程网 >编程开发 >C#教程 >C#使用linq对数组进行筛选排序的方法
C#使用linq对数组进行筛选排序的方法
摘要:本文实例讲述了C#使用linq对数组进行筛选排序的方法。分享给大家供大家参考。具体如下:usingSystem;usingSystem.Co...

本文实例讲述了C#使用linq对数组进行筛选排序的方法。分享给大家供大家参考。具体如下:

using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace OrderQueryResults { class Program { static void Main(string[] args) { string[] names = {"kaka","kunka","kumar","James","Smith"}; var queryResults = from n in names where n.StartsWith("k") orderby n select n; Console.WriteLine("Names beginning with k:"); foreach (var item in queryResults) { Console.WriteLine(item); } Console.ReadLine(); } } }

希望本文所述对大家的C#程序设计有所帮助。

【C#使用linq对数组进行筛选排序的方法】相关文章:

C#中常使用进度条的代码

使用C#开发Socket通讯的方法

解决C#中取消方向键对控件焦点控制的实现方法

C#操作注册表的方法

使用SmtpClient发送邮件的方法

C# 禁用鼠标中间键的方法

c#之利用API函数实现动画窗体的方法详解

C#计算代码执行时间的方法

C#中使用IrisSkin2.dll美化WinForm程序界面的方法

C#使用DllImport调用非托管的代码的方法

精品推荐
分类导航