标签:class out 字符 ati 字符串 一个 bsp ring java
public class CountJava{ public static void main(String[] args){ String str = "dnajjavaNISLjavaERBjavafvsbdjavaFALjavaEUIcjavazs"; int count = 0; int index = 0; while(str.indexOf("java") != -1){ index = str.indexOf("java"); str = str.substring(index + 4); count++; } System.out.println("字符串java出现次数为" + count); } }
标签:class out 字符 ati 字符串 一个 bsp ring java
原文地址:https://www.cnblogs.com/yxfyg/p/12365875.html