public class JudgeChinese {
    public static void main(String[] args) {
        String s = "中文1";
        String regex = "[\u4E00-\u9FA5]+";
        if (s.matches(regex)) {
            System.out.println("输入是中文");
        }else{
            System.out.println("输入的不是中文");
        }
    }
}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-22
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
  • 2021-12-04
  • 2021-06-21
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
相关资源
相似解决方案