在VB中,可以使用以下方法給數組賦值:
Array
函數: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
函數將字符串分割為數組:Dim arr() As String
arr = Split("apple,orange,banana", ",")