判断每个字符串是否包含中文

来源:互联网 发布:下载b612软件下载 编辑:程序博客网 时间:2024/05/29 13:39

String a="helll 你好你好,ddddd";

 Pattern pattern=Pattern.compile("[\u4e00-\u9fa5]");  
    Matcher matcher=pattern.matcher(a);
    //判断路径是否包含中文,就修改图片的名字
    if(matcher.find()){
     renameCircuitryPic(url, dirPaths, dirPath, service, tattment); 
    }