string test = "good good study day day up";
string r = test.Replace("oo","");
int num = (test.Length - r.Length) /2;
Response.Write(num);
gyrfzq 的做法很聪明,不过我觉得也可以象这样做
string aaa = "aabaabbaabb";
int a= aaa.Split(new string[] { "aa" }, StringSplitOptions.None).Length-1;