Linq在Array,List,Dictionary中的应用

今天在实际工作中需要对array,list,dictionary进行排序,试一试linq,发现非常好用,代码如下:

 using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions; namespace Test
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello world!");
string inputStr = " abf dcf frgt ";
inputStr = Regex.Replace(inputStr.Trim(), " {2,}", " ");
Console.WriteLine(inputStr); int[] num = { , , , , , , , , , };
//Array.Sort(num);
var nums = (from l in num orderby l select l).ToArray();
Console.Write("Array:\n");
foreach (int i in nums)
Console.Write(i.ToString());
Console.Write("\nList:\n");
List<int> list = new List<int>() {,,,,,, };
list = (from l in list orderby l select l).ToList();
foreach (var l in list)
Console.Write(l);
Dictionary<int, int> counts = new Dictionary<int, int>() { {,},{,},{,}};
//var results = (from d in counts orderby d.Value descending select d).Take(2).ToDictionary(k => k.Key, v => v.Value);
var results = (from d in counts orderby d.Value descending select d.Key).Take().ToArray();
Console.Write("\nDictionary:\n");
foreach (var d in results)
Console.WriteLine(d); Console.ReadKey();
}
}
}

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAABMcAAALbCAIAAABxNXDaAAAgAElEQVR4nO3d/48j533Ycf4Z+R/4H9x/UHTSpG5cO27aHOrigAKD/tQWaJEGieXYGtuyNqnlWKkcW7FGthVLtWP77KJBQjf5oQXkpLDdKsUBBYrAX6o7SXeST5aBnrY/cJecmeeZ4fCzQy6X+3qBCHR8yGeG3N2Abz8zw9kvPPaKm5ubm5ubm5ubm5ubm1vsNvuFx145BQAAgO2pSgAAAOJUJQAAAHGqEgAAgDhVCQAAQJyqBAAAIE5VAgAAEKcqAQAAiFOVAAAAxKlKAAAA4lQlAAAAcWOr8nvf/8ELL31j4+3JT39+eXvhpW/8y9/8xHf/+nuPHj3aw8sAAADgUoytysV3/uInd1/f9vY//ubOO++8s4eXAQAAwKXYoirfffdR/+3dR4/+3/LWvP8Hr/RX5Z2TG7PZbDa7cXLn9q3Z7MbJndPT09P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TlQAAAMSpSgAAAOJUJQAAAHGqEgAAgDhVCQAAQJyqBAAAIE5VAgAAEKcqAQAAiFOVAAAAxKlKAAAA4lQlAAAAcaoSAACAOFUJAABAnKoEAAAgTlUCAAAQpyoBAACIU5UAAADEqUoAAADiVCUAAABxqhIAAIA4VQkAAECcqgQAACBOVQIAABCnKgEAAIhTlQAAAMSpSgAAAOJUJQAAAHGqEgAAgDhVCQAAQJyqBAAAIE5VAgAAEKcqAQAAiFOVAAAAxKlKAAAA4lQlAAAAcaoSAACAOFUJAABAnKoEAAAgTlUCAAAQpyoBAACIU5UAAADEpVV58+bNbEBm71eVAAAA11q2KtOAzN6pKgEAAK67vqpsNmR6j6oEAABgNus5r7KZkQNJqSoBAACuu76r9dxsyz5GVQIAAFx3A9eA3ZiUqhIAAOC6G/5mkeGkVJUAAADXne+rBAAAIE5VAgAAEKcqAQAAiFOVAAAAxKlKAAAA4lQlAAAAcdNUpZubm5ubm5ubm5ubm5tb7Pb/AcJ8ihwMSTENAAAAAElFTkSuQmCC" alt="" />

Linq在Array,List,Dictionary中的应用的更多相关文章

  1. C#中如何查找Dictionary中的重复值

    简介 在这篇帮助文档中,我将向你展示如何实现c#里字典中重复值的查找.你知道的对于一个老鸟来说,这是非常简单的代码.但是尽管如此,这也是一篇对c#初学者非常有用的帮助文档. 背景 多数程序员对小型数据 ...

  2. [Swift通天遁地]五、高级扩展-(6)对基本类型:Int、String、Array、Dictionary、Date的扩展

    ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★➤微信公众号:山青咏芝(shanqingyongzhi)➤博客园地址:山青咏芝(https://www.cnblogs. ...

  3. C#在Dictionary中使用枚举作为键

    Enum类型没有实现IEquatable接口,Dictionary中使用Enum作为键时,将发生装箱,使效率降低. 此时可用Dictionary中一个接收IEqualityComparer<T& ...

  4. 转<<C#集合Dictionary中按值的降序排列

    转载地址:http://blog.sina.com.cn/s/blog_5c5bc9070100pped.html C#集合Dictionary中按值的降序排列 static void Main(st ...

  5. NullableKey:解决Dictionary中键不能为null的问题 zt

    2012-12-29 02:26 by 老赵, 1745 visits 众所周知,.NET中Dictionary的键不能为null,否则会抛出NullReferenceException,这在某些时候 ...

  6. Foundation--NSString , array and Dictionary

    一,NSString的创建 NSString*str=@" a string ";//直接创建一个字符串常量,这样创建出来的字符串不需要释放内存 NSLog(@"%@&q ...

  7. C# List、Array、Dictionary之间相互转换

    Array转换为List List转换为Array Array转Dictionary Dictionary转Array List转Dictionary Dictionary转List IQueryab ...

  8. C#集合Dictionary中按值的排序

    C#集合Dictionary中按值的降序排列 static void Main(string[] args) {             Dictionary<string, int> d ...

  9. Linq/List/Array/IEnumerable等集合操作

    来源:http://www.cnblogs.com/liushanshan/archive/2011/01/05/1926263.html 目录 1    LINQ查询结果集    1 2    Sy ...

随机推荐

  1. 在Linux系统下运行微信Web开发者工具

    微信Web开发者工具只有window版本和mac版本,如果想要在Linux系统下运行微信Web开发者工具,需要花费很大周折. 注:带 * 的步骤或文件为不确定是否管用的步骤或文件.本人系统为Linux ...

  2. C#文件安全管理解析

    在实际的项目开发中,我们经常需要使用到文件的I/O操作,主要包含对文件的增改删查等操作,这些基本的操作我们都是很熟悉,但是较少的人去考虑文件的安全和操作的管理等方面,例如文件的访问权限管理,文件数据的 ...

  3. EntityFramework的多种记录日志方式,记录错误并分析执行时间过长原因(系列4)

    前言 Entity Framework 延伸系列目录 今天我们来聊聊EF的日志记录. 一个好的数据库操作记录不仅仅可以帮你记录用户的操作, 更应该可以帮助你获得效率低下的语句来帮你提高运行效率 废话不 ...

  4. 由js apply与call方法想到的js数据类型(原始类型和引用类型)

    原文地址:由js apply与call方法想到的js数据类型(原始类型和引用类型) js的call方法与apply方法的区别在于第二个参数的不同,他们都有2个参数,第一个为对象(即需要用对象a继承b, ...

  5. Android中Fragment和ViewPager那点事儿(仿微信APP)

    在之前的博文<Android中使用ViewPager实现屏幕页面切换和引导页效果实现>和<Android中Fragment的两种创建方式>以及<Android中Fragm ...

  6. 解决maven下载jar慢的问题(如何更换Maven下载源)

    修改 配置文件 maven 安装 路径 F:\apache-maven-3.3.9\conf 修改 settings.xml 在 <mirrors> <!-- mirror | Sp ...

  7. ubuntu进行子域名爆破

    好记性不如烂笔头,此处记录一下,ubuntu进行子域名的爆破. 先记录一个在线的子域名爆破网址,无意中发现,很不错的网址,界面很干净,作者也很用心,很感谢. https://phpinfo.me/do ...

  8. 《MSSQL2008技术内幕:T-SQL语言基础》读书笔记(下)

    索引: 一.SQL Server的体系结构 二.查询 三.表表达式 四.集合运算 五.透视.逆透视及分组 六.数据修改 七.事务和并发 八.可编程对象 五.透视.逆透视及分组 5.1 透视 所谓透视( ...

  9. NodeJS的代码调试和性能调优

    本文转自我的个人博客. NodeJS 自 2009 年显露人间,到现在已经六个年头了,由于各种原因,中间派生出了个兄弟,叫做 iojs,最近兄弟继续合体,衍生出了 nodejs4.0 版本,这东西算是 ...

  10. .NET 环境中使用RabbitMQ

    在企业应用系统领域,会面对不同系统之间的通信.集成与整合,尤其当面临异构系统时,这种分布式的调用与通信变得越发重要.其次,系统中一般会有很多对实时性要求不高的但是执行起来比较较耗时的地方,比如发送短信 ...