读书人

判断字段是不是包含中文

发布时间: 2012-11-23 00:03:43 作者: rapoo

判断字段是否包含中文

/** * 判断字段是否包含中文 *  * @param str * @return */public boolean includeChinese(String str){final int max = 0xff00;boolean isIncluCH = false;for (int i = 0; i < str.length(); i++){char c = str.charAt(i);if ((c & max) != 0){isIncluCH = true;break;}}return isIncluCH;}
?http://blog.csdn.net/ferndean/article/details/7836787

读书人网 >Web前端

热点推荐