当前位置:Gxlcms > 数据库问题 > 不使用数据库,用程序快速排重

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

时间:2021-07-01 10:21:17 帮助过:2人阅读

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

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

标签:

人气教程排行