public class EmployeeDemo { //方法一: public int search(String str,String strRes) {//查找字符串里与指定字符串相同的个数 int n=0;//计数器 // for(int i = 0;i<str.length();i++) { // // } while(str.indexOf(strRes)!=-1) { int i = str.indexOf(strRes); n++; str = str.substring(i+…
Let the Balloon Rise. 最近开始刷hdoj,想通过写博客做做笔记,记录写过代码. Problem Description Contest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges' favorite time is guessing the most popular problem. When the contest i…
方法一: public static int indexOf (字符串/字符,int从第几位开始,int共查几位) string tests = "1absjjkcbfka2rsbcfak2bfka1"; //测试字符串 int i = tests.IndexOf("2b",5,tests.Length-5); //查找从第五字符向后查找“2b” textBox2.Text = i.ToString(); int i = tests.IndexO…