asp 统计数组元素个数

请问一下各位,用ASP怎么测出array里面的元素个数:
<%
str=array("ASP","PHP","JSP","ASP.NET")
response.Write(count(str))
%>
显示count的函数错误啊,只能按照下面的写法啊:是可以正确显示,但是感觉有点问路不对啊,ASP里面的count函数是怎么用的呢?
<%
str=array("ASP","PHP","JSP","ASP.NET")
response.Write(ubound(str)+1)
%>

第1个回答  推荐于2016-01-25
Ubound(str)
返回的是数组 "str" 的最大下标,也就是可以返回数组元素的个数。个数 = 最大下标 + 1,因为下标从0开始。本回答被提问者采纳
第2个回答  2011-07-01
asp里没有你用这个函数,数组定义是这样的
dim s(5);
s(1)="ASP"
s(2)="PHP"
s(3)="JSP"
s(4)="ASP.NET"
response.write(ubound(s))
第3个回答  2011-06-28
Count 属性返回在 Dictionary 对象中 key/item 对的数目。
http://www.w3school.com.cn/asp/prop_count.asp

count不对array操作
相似回答