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

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

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

你可能感兴趣的:(字符串)