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

判断字符串是不是为英文

2012-11-06 
判断字符串是否为英文?public static boolean isEnglish(String word) {boolean isEnglish falsefor (i

判断字符串是否为英文

?

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

热点排行