流浪の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  朱龙旭的网络  阅读(16)  评论(0)    收藏  举报