[Color=Blue]Private Sub [/Color]Button1_Click([Color=Blue]ByVal [/Color]sender [Color=Blue]As [/Color]System.Object, _
[Color=Blue]ByVal [/Color]e [Color=Blue]As [/Color]System.EventArgs) [Color=Blue]Handles [/Color]Button1.Click
[Color=Green] 'Create empty array that can hold 3 rows
[/Color] [Color=Blue]Dim [/Color]Test [Color=Blue]As [/Color]String()() = [Color=Blue]New [/Color]String(2)() {}
[Color=Green] 'Create and populate rows.[/Color]
[Color=Blue]For [/Color]i [Color=Blue]As Integer [/Color]= 0 [Color=Blue]To[/Color] 2
Test(i) = [Color=Blue]New [/Color]String(2) {} [Color=Green]'Create a row with 3 items[/Color]
[Color=Green]
'Populate row[/Color]
[Color=Blue]For [/Color]j [Color=Blue]As Integer [/Color]= 0 [Color=Blue]To [/Color]2
Test(i)(j) = Chr(65 + j + i * 3)[Color=Green] 'Set a single, unique character.[/Color][Color=Blue]
Next
Next[/Color]
OutputArray(Test)
MessageBox.Show("Click OK to swap")
[Color=Green] 'Swap two rows
[/Color] [Color=Blue]Dim [/Color]placeholder [Color=Blue]As [/Color]String() = Test(1)
Test(1) = Test(0)
Test(0) = placeholder
OutputArray(Test)
[Color=Blue]End Sub[/Color]
[Color=Blue]Sub [/Color]OutputArray([Color=Blue]ByVal [/Color]data [Color=Blue]As [/Color]String()())
txtOutput.Clear()
[Color=Blue]For [/Color]i [Color=Blue]As Integer [/Color]= 0 [Color=Blue]To [/Color]UBound(data)
[Color=Blue]For [/Color]j [Color=Blue]As Integer [/Color]= 0 [Color=Blue]To [/Color]UBound(data(i))
txtOutput.Text &= data(i)(j) & "; "
[Color=Blue]Next[/Color]
txtOutput.Text &= Environment.NewLine
[Color=Blue] Next
End Sub[/Color]