方法一
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 閱讀(302)
評論(0) 編輯 收藏 所屬分類:
java