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;
}
}
}
查看第二个参数在第一个参数中出现的次数
最新推荐文章于 2022-02-28 12:50:44 发布