package myfrist; public class Number { public static void main(String[] args) { // TODO 自动生成的方法存根 String str1 = new String("mingrikejijavabu"); String str2 =str1.replace("i",""); System.out.println("i的次数是="+(str1.length()-str2.length())); } }
package myfrist; public class Number { public static void main(String[] args) { // TODO 自动生成的方法存根 String str1 = new String("mingrikejijavabu"); String str2 =str1.replace("i",""); System.out.println("i的次数是="+(str1.length()-str2.length())); } }