zoukankan      html  css  js  c++  java
  • C# Distanct List集合

    简单一维集合的使用

    //实例2个集合
    List < int > ages = new List < int >{21, 46, 46, 55, 17, 21, 55, 55}; List < string > names = new List < string >{"wang", "li", "zhang", "li", "wang", "chen", "he", "wang"};
    IEnumerable
    < int > distinctAges = ages.Distinct(); Console.WriteLine("Distinct ages:"); foreach(int age in distinctAges) { Console.WriteLine(age); } var distinctNames = names.Distinct(); Console.WriteLine(" Distinct names:");
    foreach(string name in distinctNames) { Console.WriteLine(name); }
    List
    < int > ages = new List < int >{21, 46, 46, 55, 17, 21, 55, 55}; List < int > disAge = ages.Distinct().ToList(); //除重 foreach(int a in disAge) Console.WriteLine(a);
  • 相关阅读:
    bootstrap常用快捷查找
    jquery
    javascript
    移动端心得总结
    css。过渡动画
    css。。段落样式
    css。元素样式、边框样式
    css3
    css
    Hbuilder 的快捷方式
  • 原文地址:https://www.cnblogs.com/ZkbFighting/p/7794035.html
Copyright © 2011-2022 走看看