码迷,mamicode.com
首页 > 数据库 > 详细

不使用数据库,用程序快速排重

时间:2015-08-14 15:36:26      阅读:180      评论:0      收藏:0      [点我收藏+]

标签:

static void DistinctTest()
{
int[] echo = { 1, 1, 2, 3, 4, 5, 5, 6, 6, 7, 8, 9, 8, 10 };
IEnumerable<int> ienumerable = echo.Distinct();//去重,返回IEnumerable
int[] newecho = ienumerable.ToArray();//重新转换成数组
foreach (int i in newecho)
{
Console.WriteLine(i);
}
Console.ReadKey();
}

不使用数据库,用程序快速排重

标签:

原文地址:http://www.cnblogs.com/chinaboyzzy/p/4729898.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!