取到一个字符串,在工作中会出现去掉该所有中文的时候,用java实现:
public static void main(String[] args) throws Exception {
String REGEX_CHINESE = "[\u4e00-\u9fa5]";
String str = "243dfzc.;去掉中文hsdu真";
str = str.replaceAll(REGEX_CHINESE,"");
System.out.println(str);
}
控制台输出结果:243dfzc.;hsdu