var dictionary = new Dictionary<char,int>(); foreach (var character in myString.ToUpper()) { if (dictionary.ContainsKey(character)) { dictionary[character]++; } else { dictionary.Add(character, 1); } }