2010年9月16日 星期四
多個1維陣列合併
==code===
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim a(9) As Integer
Dim b(9) As Integer
For i As Integer = 0 To 9
a(i) = i
Next
For i As Integer = 0 To 9
b(i) = i + 10
Next
Dim temp As New List(Of Integer)
temp.AddRange(a)
temp.AddRange(b)
Dim all As Integer() = temp.ToArray
ListBox1.Items.Clear()
For i As Integer = 0 To UBound(all)
ListBox1.Items.Add(all(i).ToString)
Next
End Sub
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言