Dim i As Integer
Dim strAll As String
Dim strCity() As String
strAll = "北京_上海_湖北_江西_浙江"
strCity = Split(strAll, "_", , vbTextCompare)
For i = 0 To UBound(strCity)
Debug.Print strCity(i)
Next
Dim strAll As String
Dim strCity() As String
strAll = "北京_上海_湖北_江西_浙江"
strCity = Split(strAll, "_", , vbTextCompare)
For i = 0 To UBound(strCity)
Debug.Print strCity(i)
Next
解决方案 »
- 如何将数组里的字节流图片显示在界面上?
- 怎么实现工业称的去皮功能,用VB写的
- 请问大家 一个问题,当MSFLEXGRID和TEXTBOX绑定后,当焦点在TEXTBOX中时,怎样能用方向键控制MSFLEXGRID的滚动??
- Data 控件问题
- 关于数据集合的问题
- 偶用compactdatabase方法压缩数据库,原库有密码,但压缩后的库文件却无密码,不知如何是好?
- 网上考试系统热卖中............(请版主勿删)
- 多线程问题:开始一个线程后……
- 怎样能赠分:怎样看自己现在有多少分。。?thank you
- 关于Getsetting函数访问注册表的问题(急阿)
- 有问题,巴顿,泡泡龙过来看看
- 想要vb中对一维数组排序的代码,急!
Dim strAll As String
Dim strCity() As String
strAll = "北京_上海_湖北_江西_浙江"
strCity = Split(strAll, "_", , vbTextCompare)
For i = 0 To UBound(strCity)
Debug.Print strCity(i)
Next
Dim Str As String
Dim TempStr As String
Str = "北京_上海_湖北_江西_浙江"
List1.Clear
Do While Not InStr(Str, "_") = 0
List1.AddItem Left(Str, InStr(Str, "_") - 1)
Str = Right(Str, Len(Str) - InStr(Str, "_"))
Loop
If Not Len(Str) = 0 Then
List1.AddItem Str
End If
End SubPrivate Sub Form_Load()
List1.Top = 50
List1.Left = 50
Command1.Top = 50
Command1.Left = 50 + List1.Width + 50
Width = List1.Width + Command1.Width + 300
Height = List1.Height + 600
Command1.Caption = "Begin"
End Sub
List1.Top = 50
List1.Left = 50
Command1.Top = 50
Command1.Left = 50 + List1.Width + 50
Width = List1.Width + Command1.Width + 300
Height = List1.Height + 600
Command1.Caption = "Begin"
End SubPrivate Sub Command1_Click()
Dim Str As String
Dim TempStr As String
Str = "北京_上海_湖北_江西_浙江"
List1.Clear
Do While Not InStr(Str, "_") = 0
List1.AddItem Left(Str, InStr(Str, "_") - 1)
Str = Right(Str, Len(Str) - InStr(Str, "_"))
Loop
If Not Len(Str) = 0 Then
List1.AddItem Str
End If
End Sub'VB5.0、VB6.0都通过
List1.Top = 50
List1.Left = 50
Command1.Top = 50
Command1.Left = 50 + List1.Width + 50
Width = List1.Width + Command1.Width + 300
Height = List1.Height + 600
Command1.Caption = "Begin"
End SubPrivate Sub Command1_Click()
Dim Str As String
Dim TempStr As String
Str = "北京_上海_湖北_江西_浙江"
List1.Clear
Do While Not InStr(Str, "_") = 0
List1.AddItem Left(Str, InStr(Str, "_") - 1)
Str = Right(Str, Len(Str) - InStr(Str, "_"))
Loop
If Not Len(Str) = 0 Then
List1.AddItem Str
End If
End Sub'VB5.0、VB6.0都通过
Dim i As Integer
Dim strAll As String
Dim strCity() As String
strAll = "北京_上海_湖北_江西_浙江"
strCity = Split(strAll, "_", , vbTextCompare)
For i = 0 To UBound(strCity)
List1.AddItem strCity(i)
Next
End Sub
'VB6.0通过 VB5.0通不过