asp中怎么取出字符串中的数字

如题所述

你好,给你个取数字的方法和例子:

<%
str="0123tt9str"'含有01239数字,其他为字母,下面代码可以把数字提取出来
for i=1 to len(str)
     s=mid(str,i,1)
     if asc(s)>=asc(0) and asc(s)<=asc(9) then
        l=l&s
     end if   
next
response.write l
%>
温馨提示:答案为网友推荐,仅供参考