5 ms·
text.Split(' ').Where(x=>!string.IsNullOrWhiteSpace(x)).GroupBy(x => x).Select(x => new { word = x.Key, count = x.Count() }).OrderByDescending(x => x.count).Sel
by coderguy123 13y ago
text.Split(' ').Where(x=>!string.IsNullOrWhiteSpace(x)).GroupBy(x => x).Select(x => new { word = x.Key, count = x.Count() }).OrderByDescending(x => x.count).Select(x=>x.word).Take(10).ToArray();