Office中国论坛/Access中国论坛
标题:
C# List.Distinct简单去重方法Demo
[打印本页]
作者:
闻启学
时间:
2014-3-26 17:19
标题:
C# List.Distinct简单去重方法Demo
List<int> ages = new List<int> { 21, 46, 46, 55, 17, 21, 55, 55 };
IEnumerable<int> distinctAges = ages.Distinct();
Console.WriteLine("Distinct ages:");
foreach (int age in distinctAges)
{
Console.WriteLine(age);
}
/*
This code produces the following output:
Distinct ages:
21
46
55
17
*/
复制代码
作者:
cc1027cc
时间:
2014-3-26 17:44
学习了!赞个。。。顶
作者:
Alashome
时间:
2015-6-26 09:11
good
欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/)
Powered by Discuz! X3.3