char[] a=str.toCharArray();//字符串str
for(int i=0;i<a.length;i++){
if(java.lang.Character.isDigit(a[i]))
{
id = Integer.parseInt(worker_id);
}
else{
out.print("<script>");
out.print("alert('编号只能为数字!');");
out.print("top.location.href ='index.jsp' ");
out.print("</script>");
}
}
java判断字符串是否为数字
最新推荐文章于 2023-10-31 14:38:57 发布