1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| package asd;
public class demo1 { public static void main(String[] args) { String word="我cnm的臭逼,你全家都是人才,傻帽"; String []arrword={"cnm","臭逼","傻帽"}; for (int i = 0; i < arrword.length; i++) { word= word.replace(arrword[i],"***"); } System.out.println(word); } }
|