LINQ 统计字符频率
var arr = new string[] {"test","zhulongxu","asdfdgd","yangmi","sdfytersy"}; var query = from w in arr from c in w group c by c into g select new { g.Key, Count = g.Count() } into a orderby a.Count descending select a; query.Dump();
卷帝
var arr = new string[] {"test","zhulongxu","asdfdgd","yangmi","sdfytersy"}; var query = from w in arr from c in w group c by c into g select new { g.Key, Count = g.Count() } into a orderby a.Count descending select a; query.Dump();