简单问题 怎么定义数组,怎么将字符串加到数组中?
dim arri() as string
for i = 1 to a-1 'a为数组长度最大值
arri(i)=ttt 'ttt为字符串
next
大概意思是这样。。具体要怎么写呢?
[解决办法]
一种定义方法:声明中指定数组初始长度或用大括号直接给数组赋值
Dim arry(9) As String
For i As Integer = 0 To arry.Length - 1
arry(i) = "12333333333333 "
Next
还有一种方法:声明中既不指定数组长度也不用大括号给数组赋值,这样的数组是用来接受其他程序或某对方的方法所返回的数组
Dim myArray() As String
myArray = Array()
Public Function Array()
Dim a(3) As String
For i As Integer = 0 To a.Length - 1
a(i) = "11111 "
Next
Return a
End Function