Assign-> sentence = "He rang the Bell I rang the Bell everyone rang the Bell"
Assign-> wordCounts = sentence.Split(" "c).GroupBy(Function(word) word.ToUpper()).ToDictionary(Function(group) group.Key, Function(group) group.Count())
Msg Box -> String.Join(vbCrLf,wordCounts)
sentence is of DataType System.String wordCounts is of DataType System.Collections.Generic.Dicitonary(System.String, System.Int32)
Assign-> sentence = "He rang the Bell I rang the Bell everyone rang the Bell"
Use below code in Invoke Code:
Dim wordCounts = sentence.Split(" "c) _
.GroupBy(Function(word) word.ToUpper()) _
.OrderBy(Function(Group) Group.Count()) _
.ToDictionary(Function(Group) Group.Key, Function(Group) Group.Count())
For Each pair In wordCounts
Console.WriteLine($"{pair.Key} - {pair.Value}")
Next