28,390
社区成员
发帖
与我相关
我的任务
分享
<%
a="1,2,3|4,5,6|7,8,9"
b=split(a,"|")
for i=0 to ubound(b)
b(i)=split(b(i),",")
Next
'Display the array
For i =0 To UBound(b)
For j=o To UBound(b(i))
response.write b(i)(j)
Next
Next
%>
test:Sub test()
Dim i,j,aastr,str
aastr=str2ary("1,2,3|4,5,6|7,8,9")
For i=0 To UBound(aastr,1)
For j=0 To UBound(aastr,2)
str=str & aastr(i,j) & " "
Next
str=str & vbcrlf
Next
MsgBox str
End Sub
function str2ary(strIn)
Dim str,astr,aastr,astrtmp,iubound1,iubound2,i,j
astr=split(strIn,"|")
iubound1=ubound(astr)
iubound2=ubound(split(astr(0),","))
redim aastr(iubound1,iubound2)
for i=0 to iubound1
astrtmp=split(astr(i),",")
For j=0 To iubound2
aastr(i,j)=astrtmp(j)
next
next
str2ary=aastr
end function
'--------------