您的位置:首页 > 其它

查看第二个参数在第一个参数中出现的次数

2014-09-18 14:14 239 查看
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace testfour
{
class Program
{
static void Main(string[] args)
{
MyClass myclass = new MyClass();
int num =  myclass.CountChar("fdfdfdfcxvcxcdfsdffvcdv", 'd');
Console.WriteLine(num);
Console.Read();
}

}
class MyClass
{
public
int CountChar(String str,char ch)
{
return str.Split(ch).Length - 1;
}
}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐