统计某字符串是否包含另一字符串
string str = "ABCDEFBD ";
我想从字符串中得到的结果是
A 1
B 2
C 1
D 2
E 1
F 1
...
这个在程序上怎么处理?
------解决方案--------------------string str = "ABCDEFBD ";
for (char c = 'A '; c <= 'F '; c++)
textBox1.AppendText(c + "= " +
(str.Length - str.Replace(c + " ", " ").Length).ToString() + "\r\n ");