【发布时间】:2017-05-02 12:57:21
【问题描述】:
我得到了一个逗号分隔值列表 (a,b,c,d,e,f,g,h,....) 我希望将它们分成 5 个块,例如 (a,b,c,d,e) (f,g,h,i,j).... 有人可以帮我编写经典 asp 中的代码吗?
arr = Split(messto, ",") ' convert to array
totalemails = UBound(arr) ' total number of emails
if totalemails mod 5 = 0 then
totalloops = int(totalemails/5)
else
totalloops = int(totalemails/5) + 1
end if
x = 0
y = 0
b = 0
for x = 0 to totalloops
for counter = (5* x) to ((b+5)-1)
if Trim(arr(counter)) <> "" and isnull(trim(arr(counter))) = false then
response.Write(Trim(arr(counter)))
response.Write(counter & "<br>")
mymssto = mymssto & Trim(arr(counter)) & ","
response.Write(mymssto)
end if
next
【问题讨论】:
标签: vbscript split asp-classic chunks