方法1:Regex.Matches(要找的字符堆,指定字符串).Count 方法2:int count=(str.Length-str.Replace("特定字符串","").Length)/特定字符串长度