汇编语言程序,求解答,急,谢谢

2025-03-10 18:44:47
推荐回答(1个)
回答1:

function isdata(s)
{
var patrn1=/^[A-Z]+$/;
var patrn2=/^[a-z]+$/;
var patrn3=/^[A-Za-z]+$/;
if(patrn3.exec(s)){//验证所输入全为字母

if (patrn1.exec(s)){//所输入全为大写
s.tolocaleLowerCase( );//转换小写
} else if(patrn2.exec(s)){//所输入全为小写
stolocaleUpperCase( );//转换大写
}else{//所输入有大写有小写
alert("请全部小写或大写");
}
} else{//不全为字母
alert("please input a character");
}
}