ASP的一个小问题,帮我呀

来源:百度知道 编辑:UC知道 时间:2024/06/25 18:50:52
有一个字符串,是以下样子 689,567,888,999 里面有可能是有空的,比如689,,,999,或者,,888,999
我该怎么用ASP判断在这字符串中必须最少有两组数字,而且如果不为空的话,必须是大于0的整数呢

简单点就是,在689,567,888,999 里,最少要有两组大于0的整数
补充一下呀

判断完了后,把空的剔除掉,只留下有数字的,比如666,777 345,2111,678

应该怎么写ASP

我会

超简单
hi我

<%
a="689,567,888,999"
a=split(a,",")
b=0
for i=0 to ubound(a)
if IsNumeric(a(i)) then
if a(i)>0 then
b=b+1
end if
end if
next
if b<2 then
response.Write "数组里没有2组大于0的数字"
else
response.Write "数组符合要求"
end if

%>

dim str,ary,i,n
str="689,567,888,haha,,999"
ary=split(str,",")
n=0
for i=0 to ubound(ary)
if ary(i)<>"" and isNumeric(ary(i)) then
if ary(i)>0 then
n=n+1
end if
end if
next
if n>1 then
response.Write("符合条件")
else
response.Write("Error")
end if

<%
dim str,ary,i,n
str="689,567,888,haha,,999"
ary=split(str,",")
str = ""
n=0
for i=0 to ubound(ary)
if ary(i)<>"" then