0

如果列表中有下一个元素,我如何在 ASP 中测试?我正在尝试做这样的事情:

a=Split("foo, boo, luu, bar", ",")
for each x in a
    response.write("'" & x & "'")       
    if a.HasNext then
        response.write(",")
    end if
next

它是如何工作的?

谢谢!

4

1 回答 1

2

没有 HasNext 但您可以测试数组的大小

a=Split("foo, boo, luu, bar", ",")
i = 0
for each x in a
    response.write("'" & x & "'")       
    if i < Ubound(a) then
        response.write(",")
    end if
    i = i + 1
next
于 2013-01-30T21:40:10.110 回答