Mega Code Archive

 
Categories / VB.Net / Data Structure
 

Array UBound

Public Class MainClass    Public Shared Sub Main()         Dim arrMyIntArray1(20) As Integer         Dim arrMyIntArray2() As Integer = {1, 2, 3, 4}         Dim arrMyIntArray3(4, 2) As Integer         Dim arrMyIntArray4(,) As Integer = _         {{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}, {13, 14, 15, 16}}         Dim arrMyIntArray5() As Integer         Console.WriteLine(CStr(UBound(arrMyIntArray2)))         arrMyIntArray2.GetUpperBound(0)         Dim intLoop1 As Integer         Dim intLoop2 As Integer         For intLoop1 = 0 To UBound(arrMyIntArray4)             For intLoop2 = 0 To UBound(arrMyIntArray4, 2)                 Console.WriteLine(arrMyIntArray4(intLoop1, intLoop2).ToString)             Next         Next             End Sub End Class