下面两个函数实现了对字符串中数字的判断。
function isnaw(str)
for i=1 to len(str)
str1=mid(str,i,1)
if isnumeric(str1) then isn=1
if (Asc(str1)> Asc( "a ") and Asc(str1) <Asc( "z ")) or (Asc(str1)> Asc( "A ") and Asc(str1) <Asc( "Z ")) then isw=1
next
if isn=1 and isw=1 then
isnaw=true
else
isnaw=false
end if
end function
for i=1 to len(str)
str1=mid(str,i,1)
if isnumeric(str1) then isn=1
if (Asc(str1)> Asc( "a ") and Asc(str1) <Asc( "z ")) or (Asc(str1)> Asc( "A ") and Asc(str1) <Asc( "Z ")) then isw=1
next
if isn=1 and isw=1 then
isnaw=true
else
isnaw=false
end if
end function
使用方法:
pw= "123aspxhome.com"
if isnaw(pw) then
response.write "y "
else
response.write "n "
end if
if isnaw(pw) then
response.write "y "
else
response.write "n "
end if
站长工具
相关文章

请稍等,评论加载中...