vb split 用法For i = 1 To AllNum1(LineNum1) NumberNum1(LineNum1,i) = Split(Split(s,",")(i),",")(0)Next i 尤其是Split(Split(s,",")(i),",")(0)怎么理解?特别是Split(Split(s,",")(i),",")后面的那个(0)什么意思啊?split函数后面加个(0)怎么理解,我把代码发全一点,代码没问题,测试过了Open PathIn1 For Input As #1Do Until EOF(1) = TrueLine Input #1,ss = "," & s & ","LineNum1 = LineNum1 + 1Nnum = 0For i = 1 To Len(s) If Mid(s,i,1) = "," Then Nnum = Nnum + 1Next iAllNum1(LineNum1) = Nnum - 1For i = 1 To AllNum1(LineNu

问题描述:

vb split 用法
For i = 1 To AllNum1(LineNum1)
NumberNum1(LineNum1,i) = Split(Split(s,",")(i),",")(0)
Next i
尤其是Split(Split(s,",")(i),",")(0)怎么理解?特别是Split(Split(s,",")(i),",")后面的那个(0)什么意思啊?split函数后面加个(0)怎么理解,
我把代码发全一点,代码没问题,测试过了
Open PathIn1 For Input As #1
Do Until EOF(1) = True
Line Input #1,s
s = "," & s & ","
LineNum1 = LineNum1 + 1
Nnum = 0
For i = 1 To Len(s)
If Mid(s,i,1) = "," Then Nnum = Nnum + 1
Next i
AllNum1(LineNum1) = Nnum - 1
For i = 1 To AllNum1(LineNum1)
NumberNum1(LineNum1,i) = Split(Split(s,",")(i),",")(0)
Next i
Loop
Close #1

Split(Split(s, ",")(i), ",")(0)输出是s字符串通过","分割后的第i个数组内的字符再次使用","分割后的第0个数组内的字符比如s=",1,2,3,4,5,"此时AllNum1(LineNum1)=5,LineNum1=1For i = 1 To AllNum1(LineNum1) ...