vb字符处理的问题
Ystr= "Aos,ous,sost,pof "
数组A()
要以 ", "为标志,将Aos,ous,sost,pof分别赋予A(1),A(2),A(3),A(4)
高手帮帮我,我写东西太复杂还容易出错,就不写上来了
PS:这个重定义数组我不是很懂,Redim 后原来的数据岂不是都没了,加了Preserve 就不能改变前一维,这该怎么解决,有空就帮答一下吧,不胜感激
------解决方案--------------------Ystr= "Aos,ous,sost,pof "
A=Array(Y)
不过数组的序号是从0开始的.
------解决方案--------------------Ystr= "Aos,ous,sost,pof "
A = Split( ", " & Ystr, ", ")
------解决方案--------------------Dim arrList()
Ystr = "Aos,ous,sost,pof "
arr = Split(Ystr, ", ")
For i = 0 To UBound(arr)
ReDim Preserve arrList(i + 1)
arrList(i + 1) = arr(i)
Next
For i = 1 To 4
Response.Write arrList(i) & " <br> "
Next