import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class RemoveStrChinese {
    private static String REGEX_CHINESE = "[\u4e00-\u9fa5]";// 中文正则
    
    public static void main(String[] args) {
        String str = "中文123中文qwer";
        // 去除中文
//        Pattern pat = Pattern.compile(REGEX_CHINESE);
//        Matcher mat = pat.matcher(str);
//        String string = mat.replaceAll("");
        
        String string = str.replaceAll(REGEX_CHINESE, "");
        System.out.println(string);
    }
}

 

相关文章:

  • 2022-12-23
  • 2022-02-16
  • 2021-05-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-07
  • 2022-01-21
  • 2021-11-22
  • 2022-12-23
  • 2022-12-23
  • 2022-02-17
相关资源
相似解决方案