查看第二个參数在第一个參数中出现的次数
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; } } }
相关文章推荐
- C#--第六周实验--任务1--返回第二个参数在第一个参数中出现次数
- c#返回第二个参数在第一个参数中出现次数
- 《编写一个方法,返回第二个参数在第一个参数中出现次数——C#第五周》
- POJ 3461 Oulipo【KMP】【模板题】(找出第一个字符串在第二个字符串中出现次数)
- 查看第二个参数在第一个参数中出现的次数
- C#程序设计(十五)----返回第二个参数在第一个参数中出现次数/参数的逆序
- 从第一个字符串中删除第二个字符串中出现的所有字符
- 第一个输入框中 输入 test,第二个输入框中自动出现 test.baibu.com
- 找出字符串中第一个出现次数最多的字符
- 输入两个字符串,从第一个字符串中删除第二个字符串中出现过的所有字符
- 剑指Offer:从第一个字符串中删除第二个字符串中出现过的所有字符
- 统计字符串中第一个出现次数为1的字符
- 统计一个数字在排序数组中出现的次数。 数组是排序的,只需要找到第一个K和最后一个K就可以知道有多少个,
- 找出字符串中第一个出现次数最多的字符
- 1,字符串排序2,第一个字符串出现,第二个字符串不出现
- 统计字符串中第一个出现次数为1的字符
- 统计字符串中第一个出现次数为1的字符
- 剑指Offer面试题37两个链表的第一个公共结点,面试题38数字在排序数组中出现的次数
- 从第一个字符串中删除在第二个字符串中出现过的所有字符
- 《c程序设计语言》读书笔记-第二个字符串任意一个在第一个字符串出现的位置,未出先返回-1