问:比如a="1,2,3,4,5",我想把1,2,3,4,5分别取出,用x=Split(a,",")这样写对不对,
x的值是什么?也就是怎么样得到1,2,3……
回答:
Dim x() as Variant
a="1,2,3,4,5"
x=Split(a,",")
a="1,2,3,4,5"
m1 = Split(a,",")(0) //1
m2 = Split(a,",")(1) //2
m3 = Split(a,",")(2) //3
m4 = Split(a,",")(3) //4
m5 = Split(a,",")(4) //5
Private Sub Command1_Click()
Dim i As Integer
Dim strAll As String
Dim strCity() As String
strAll = "1,2,3,4,5"
strCity = Split(strAll, ",", , vbTextCompare)
For i = 0 To UBound(strCity)
List1.AddItem strCity(i)
Next
End Sub
'VB6.0通过 VB5.0通不过
版权所有 2021-2024 石家庄建站平台 冀ICP备2022000585号-2 24小时服务热线:15383239821