像标题一样,运行此代码将显示其中包含所有0值的数组。
我也尝试过使用整数数组,但是我不能
Dim woohoo(9) As String
Dim count As Integer = 2
For Each number As String In woohoo
number = CStr(count)
count += 2
Next
For Each number As Integer In woohoo
Console.WriteLine(number)
Next
2,4,6,8,10 ... 20
您需要执行以下操作来设置数组的值:
Dim wooho(9) As Integer
Dim count As Integer = 2
For i As Integer = 0 To wooho.Count - 1
wooho(i) = count
count += 2
Console.WriteLine(wooho(i))
Next
这就是获取值:
For Each number As Integer In wooho
Console.WriteLine(number)
Next
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句