vb.net数组如何赋值

2024-11-15 11:13:28
推荐回答(2个)
回答(1):

Dim abc(2) As Integer
abc = {0, 1, 2}
'或者
Dim abcd() As Integer
ReDim abcd(9)
For i As Integer = 0 To abcd.Length - 1
abcd(i) = i
Next

也可声明为字符串数组

回答(2):

VB.NET要批量一般能用循环方式赋值,其中最简单的是For Next循环。