1.直接用空串替换所有的b:
String b = "abcabcabc";
b=b.replace("b","");
2.替换第一个b:
String s = "abcabcabc";
int i=s.indexOf("b");
s=s.substring(0, i)+s.substring(i+1);
System.out.println(s);
1.直接用空串替换所有的b:
String b = "abcabcabc";
b=b.replace("b","");
2.替换第一个b:
String s = "abcabcabc";
int i=s.indexOf("b");
s=s.substring(0, i)+s.substring(i+1);
System.out.println(s);