using System.Collections.Generic;
public static void Main()
var testresult = CountLetters(s);
foreach(var t in testresult)
Console.WriteLine("Letter = {0}\t Count = {1}",t.Key, t.Value);
public static IDictionary<char, int> CountLetters(string s)
string lowercase = s.ToLower();
IDictionary<char, int> result = new Dictionary<char, int>();
foreach(var c in lowercase)
if(!result.Any(x=>x.Key == c))
result.Add(c, lowercase.Where(x=>x == c).Count());