//找出字符串中“ad”的出现次数
public class Test10 {
public static void main(String[] args) {
String str="fdsasasadadafsffaewad";
String s1=str.replace("ad", "");
System.out.println((str.length()-s1.length())/2);
}
}
03-03
2643
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-17