Java - removing strange characters from a String

前端 未结 11 677
轮回少年
轮回少年 2020-12-10 03:04

How do I remove strange and unwanted Unicode characters (such as a black diamond with question mark) from a String?

Updated:

Please tell me the Unicode chara

11条回答
  •  不思量自难忘°
    2020-12-10 03:14

    filter English ,Chinese,number and punctuation

    str = str.replaceAll("[^!-~\\u20000-\\uFE1F\\uFF00-\\uFFEF]", "");
    

提交回复
热议问题