Count occurrence of each word?
string sentence = "dotnet is great dotnet is powerful";
string[] words = sentence.Split(' ');
Dictionary<string, int> map = new Dictionary<string, int>();
foreach (string word in words)
map[word] = map.ContainsKey(word) ? map[word] + 1 : 1;