VB中給數(shù)組賦值的方法有以下幾種:
Dim arr() As Integer = {1, 2, 3, 4, 5}
Dim arr(4) As Integer
For i As Integer = 0 To 4
arr(i) = i + 1
Next
Dim str As String = "1,2,3,4,5"
Dim arr() As String = str.Split(",")
Dim arr As Array = Array.CreateInstance(GetType(Integer), 5)
For i As Integer = 0 To 4
arr(i) = i + 1
Next