屏蔽某字

来源:互联网 发布:mac版finale怎么激活 编辑:程序博客网 时间:2024/06/08 15:12

字符串替换replace()方法

str.replace(char oldchar,char new char)

public class filter{public static void main(String args[]){String str="一二三四二三一二五六二四";String newstr=str.replace("一","");System.out.println(newstr);    }}

效果




0 0
原创粉丝点击