[Solved] How to display words that appear more than ‘x’ times in a text? [closed]


string text = "yay blah blah blah blah woo woo yay yay yay.";

var words = Regex.Split(text, @"\W+")
    .AsEnumerable()
    .GroupBy(w => w)
    .Where(g => g.Count() > 3)
    .Select(g => g.Key);

words.ToList().ForEach(Console.WriteLine);

Output:

yay
blah

solved How to display words that appear more than ‘x’ times in a text? [closed]