asp求和的一个问题
比如在一个字段里有这样的数据
21,12,3,4
怎么求出他们的和呢?在线等,有正确答案马上结贴
------解决方案--------------------str = "21,12,3,4 "
arr = split(str, ", ")
sum = 0
for i = 0 To UBound(arr)
sum =sum + cint(arr(i))
next
reponse.write sum
------解决方案-------------------- <%
dim str,rst
str = "21,12,3,4 "
rst = eval(replace(str, ", ", "+ "))
response.write rst
%>