阅读背景:

C#取字符串包含另一字符串的个数

来源:互联网 
int GetAppearTimes(string str1,string str2){ int i=0; while(str1.IndexOf(str2)>=0){ str1=str1.Substring(str1.IndexOf(str2)+str2.Length); i++; } return i; } int GetAppearTimes(string str1,string str2){ Regex ex=new Regex(str2); return ex.Matches(str1).Count; } Regex.Matches(str1,str2).Count; 本文来自CSDN博客,转载请标明出处:https://blog.csdn.net/yxtyxt3311/archive/2007/03/05/1521308.aspx int GetAppearTimes(string str1,string str2){ in



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: