您的位置:首页 > 其它

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

2017-06-07 18:22 176 查看
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;
}
}

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