//获取字符串中特定字符串的个数

方法1:

string[] j = tests.Split('a');

 textBox1.Text = j.Length.ToString();


方法2:

textBox2.Text = Regex.Matches(tests, "a").Count.ToString();  //获取tests中”a“的个数