package d4;
public class q1 {
public static void main(String[] args) {
String s = "打劫!我有枪,死";
glq(s);
}
private static void glq(String s) {
String[] str = {"枪", "死", "共产党", "打劫"};
for (int i = 0; i < str.length; i++) {
if (s.contains(str[i])) {
s = s.replace(str[i], "*");
System.out.println(s);
}
}
}
}
07-13
306
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)