StripNonNumeric函数源程序
程序员文章站
2022-03-30 09:56:19
<%function stripnonnumeric(strinput) dim ipos, snew, itemp ...
<%
function stripnonnumeric(strinput)
dim ipos, snew, itemp
strinput = trim(strinput)
if strinput <> "" then
ipos = 1
itemp = len(strinput)
while itemp >= ipos
if isnumeric(mid(strinput,ipos,1)) = true then
snew = snew & mid(strinput,ipos,1)
end if
ipos = ipos + 1
wend
else
snew = ""
end if
stripnonnumeric = snew
end function
%>
function stripnonnumeric(strinput)
dim ipos, snew, itemp
strinput = trim(strinput)
if strinput <> "" then
ipos = 1
itemp = len(strinput)
while itemp >= ipos
if isnumeric(mid(strinput,ipos,1)) = true then
snew = snew & mid(strinput,ipos,1)
end if
ipos = ipos + 1
wend
else
snew = ""
end if
stripnonnumeric = snew
end function
%>