如何将元素追加或添加到数组变量? [英] how to append or add elements to an array variable?
本文介绍了如何将元素追加或添加到数组变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要将一个元素附加到数组变量。
例如(我需要类似的东西):
I need to append an element to an array variable.
For example (I need something like):
dim arraystr() as string
for i=0 to 10
arraystr += i
next
输出:
output:
len(arraystr)=10
怎么做?
How to do it?
推荐答案
请看看: VB中的数组 [ ^ ]
Please, see this: Array in VB[^]
Dim s() As String
Dim i As Integer
For i = 0 To 9
ReDim Preserve s(i)
s(i) = i
Next
MsgBox UBound(s())
这篇关于如何将元素追加或添加到数组变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文