用FUNCTION过程编写程序(判断输入的字符是不是英文字符)

来源:百度知道 编辑:UC知道 时间:2024/05/28 14:12:01

<script type="text/jscript">
function checkart(string1)
{
var status=false;
for(i=0;i<string1.length;i++)
{
if(parseInt(string1.toLowerCase().charCodeAt(i))>=97 && parseInt(string1.toLowerCase().charCodeAt(i))<=122)
{
status=true;
}
else
{

status=false;
break;

}
}
return status
}

public function IsEn(byval string1 as byte) as boolean
if ucase(string1)>=65 and ucase(string1)<=90 then
IsEn=true
else
IsEn=false
end if
end function