转载
https://www.cnblogs.com/benpao/p/3308905.html
查找指定字符串的个数
//查找@@字符串的个数
string q = "AAA@@BBBB@@ASDSDF@@GGG@@";
//方式一
string[] arr = q.Split(new string[] { "@@" }, StringSplitOptions.RemoveEmptyEntries);
int len2 = arr.Length;//@@的个数
//方式二
int len = System.Text.RegularExpressions.Regex.Matches(q, "@@").Count;