1个回答
展开全部
你的目的是要VB将字符串分成单个字符。
如果要放入一个数组中,可以这样:
Private Sub Command1_Click()
Dim s As String
Dim ars() As String
Dim i As Long, m As Long
s = "abcdefg"
m = Len(s)
ReDim ars(m - 1)
For i = 1 To m
ars(i - 1) = Mid(s, i, 1)
Print ars(i - 1)
Next
End Sub
如果要放入一个数组中,可以这样:
Private Sub Command1_Click()
Dim s As String
Dim ars() As String
Dim i As Long, m As Long
s = "abcdefg"
m = Len(s)
ReDim ars(m - 1)
For i = 1 To m
ars(i - 1) = Mid(s, i, 1)
Print ars(i - 1)
Next
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询