/**********************************************************
* 函数名: IsEnglishCharacter
* 机能概要: 判断是否全为半角字符
*
* 参数: strin
* 返回值: True 全为半角
* False 不全为半角
*********************************************************/ public static boolean IsHalfWidth(String strin)
{
try{
// byte[] b = strin.getBytes("X-SJIS");
byte[] b = strin.getBytes();
if (b.length > strin.length () ) return false;
}catch(Exception e){}
return true;
}
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/12379366/viewspace-85556/
,如需转载,请注明出处,否则将追究法律责任。