自己写一个就行了,何必用正则表达式?
public int GetCharCountInString(string oStr, char cChar)
{
int count = 0;
for(int i = 0; i<oStr.Length; i++)
{
if (oStr[i] == cChar) count++;
}
return count;
}
public int GetCharCountInString(string oStr, char cChar)
{
int count = 0;
for(int i = 0; i<oStr.Length; i++)
{
if (oStr[i] == cChar) count++;
}
return count;
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货