posts - 0,  comments - 5,  trackbacks - 0

方法一
String temp = "";
temp.getBytes().length == temp.length()
判断不太准确..当数字等为全角的时候也为双字节

方法二
正则表达式
Pattern   p   =   Pattern.compile("[\\u4E00-\\u9FA5]+");   
Matcher   m   =   p.matcher(temp);     
boolean   result   =   m.find();

posted on 2007-12-16 21:07 crazy 阅读(281) 评论(0)  编辑  收藏 所属分类: java

只有注册用户登录后才能发表评论。


网站导航: