在VB中,可以使用以下方法給數(shù)組賦值:
Array
函數(shù):Dim arr(2) As Integer
arr = Array(1, 2, 3)
Dim arr(2) As Integer
arr(0) = 1
arr(1) = 2
arr(2) = 3
Dim arr(2) As Integer
For i = 0 To 2
arr(i) = i + 1
Next i
Split
函數(shù)將字符串分割為數(shù)組:Dim arr() As String
arr = Split("apple,orange,banana", ",")