首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

判断字符串是不是是中文

2012-10-31 
判断字符串是否是中文?public static boolean isChinese(String word) {boolean isChinese falsefor (i

判断字符串是否是中文

?

public static boolean isChinese(String word) {boolean isChinese = false;for (int i = 0; i < word.length(); i++) {if (word.charAt(i) >= 0x0391 && word.charAt(i) <= 0xffe5) {isChinese = true;} else {isChinese = false;break;}}return isChinese;}

热点排行