java,字符串课后练习
public class zhifuchuan { public static void main(String[] args) { String str="mingrikejijavabu"; int a=str.length(); int b=str.replace("i", "").length(); System.out.println("i出现的个数"+(a-b)); } }
public class zhifuchuan { public static void main(String[] args) { String str="mingrikejijavabu"; int a=str.length(); int b=str.replace("i", "").length(); System.out.println("i出现的个数"+(a-b)); } }