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

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();
}

posted @ 2015-08-14 14:28  南风叶  阅读(184)  评论(0编辑  收藏  举报