查找一个字符串中包含有几个指定字符串的数量

public class test{
	public static void main(String[] args){
 		String str = "abcguddcabddgudddgudd";  
	        String s = "gudd";   // 指定的字符串
	        int count = 0;  // 初始值
	        //一共有str.length()的循环次数  
	        for(int i=0; i

输出结果:

uddcabddgudddgudd
udddgudd
udd
没有了
存在3个



你可能感兴趣的:(筛选)