您的位置:首页 > 其它

如何判断一个字符串是否含有中文

2012-07-10 10:08 435 查看
public class StringUtil {
private static String pattern="[\\u4e00-\\u9fa5]+";
private static Pattern p=Pattern.compile(pattern);

public static boolean isChinese(String s)
{
Matcher result=p.matcher(s);
return result.find();
}
}


转载自:http://www.iteye.com/problems/11906
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: