List<string> AllList = new List<string>();
var q = from p in AllList group p by p into g select new { Key = g.Count(), name= g.Key };
foreach (var v in q){
Console.WriteLine("--" + v.name.ToString() + "--" + v.Key.ToString());
}
c# list<string> 分组统计
最新推荐文章于 2024-09-02 16:43:09 发布