boolean bIsChar = false;
System.out.println("strClientCode="+strClientCode);
System.out.println("strClientCode.length()="+strClientCode.length());
byte[] tempbyte = strClientCode.getBytes();
for(int i=0;i<strClientCode.length();i++)
{
System.out.println("tempbyte["+i+"]="+tempbyte[i]);
System.out.println("(char)tempbyte["+i+"]="+(char)tempbyte[i]);
if(((tempbyte[i]>=65)&&(tempbyte[i]<=90))||((tempbyte[i]>=97)&&(tempbyte[i]<=122))) //包含字母
{
bIsChar = true;
System.out.println("**************************************");
System.out.println("**********客户编号中含有字母**********");
System.out.println("**************************************");
break;
}
else
{
System.out.println("**************************************");
System.out.println("**********客户编号中不含有字母**********");
System.out.println("**************************************");
}
}
判断字符串中含有字母
最新推荐文章于 2024-05-07 08:32:38 发布