流浪のwolf

卷帝

导航

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

 

posted on 2024-05-01 10:58  流浪のwolf  阅读(6)  评论(0编辑  收藏  举报