Here's a non Linq way to get the counts of all the unique letters.
var characterCount= new Dictionary<char,int>();
foreach(var c in sign)
{
if(characterCount.ContainsKey(c))
characterCount[c]++;
else
characterCount[c] = 1;
}
Then to find out how many "a"s there are
int aCount = 0;
characterCount.TryGetValue('a', out aCount);
Or to get all the counts
foreach(var pair in characterCount)
{
Console.WriteLine("{0} - {1}", pair.Key, pair.Value);
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…