java判断字符串中是否包含汉字
package com.zuidaima.util;
/**
[emailprotected]
**/
public class test {
public static void main(String[] args) {
String a = "中国China";
for (int i=a.length(); --i>=0;) {
String b = a.substring(i, i+1);
boolean c = java.util.regex.Pattern.matches("[\u4E00-\u9FA5]", b);
if(c) {
System.out.println("此字符串包含中文");
break;
}
}
}
}
原文:/springmvc_springdata/article/details/41142927