日期:2014-05-17 浏览次数:20745 次
public static boolean existsHalfKana(String inBuff)
throws UnsupportedEncodingException {
// 半角check
if (inBuff == null) {
return false;
}
Boolean kanaFlg=true;
for (int i = 0; i < inBuff.length(); i++) {
if ('\uff61' <= (inBuff.charAt(i))&& (inBuff.charAt(i)) <= '\uff9f'
------解决方案--------------------
'\u0000' <= (inBuff.charAt(i))&& (inBuff.charAt(i)) <= '\u00ff'
------解决方案--------------------
'\uffe8' <= (inBuff.charAt(i))&& (inBuff.charAt(i)) <= '\uffee') {
kanaFlg= true;
}else{
kanaFlg= false;
break;
}
}
return kanaFlg;
}
/[\u3000-\uFFA0]/gi