Gets the lower bound of the specified dimension in the Array.
Imports System
Imports Microsoft.VisualBasic
Public Class SamplesArray
Public Shared Sub Main()
Dim my1DIntArray As Array = Array.CreateInstance(GetType(Int32), 5)
Dim i As Integer
For i = my1DIntArray.GetLowerBound(0) To my1DIntArray.GetUpperBound(0)
my1DIntArray.SetValue(i + 1, i)
Next i
Console.WriteLine(my1DIntArray.GetLowerBound(0))
Console.WriteLine(my1DIntArray.GetUpperBound(0))
PrintValues(my1DIntArray)
Console.WriteLine()
Dim my3DIntArray As Array = Array.CreateInstance(GetType(Int32), 2, 3, 4)
End Sub
Public Shared Sub PrintValues(myArr As Array)
Dim myEnumerator As System.Collections.IEnumerator = myArr.GetEnumerator()
While myEnumerator.MoveNext()
Console.WriteLine(myEnumerator.Current)
End While
End Sub
End Class
Related examples in the same category
1. | Create elements from one array to another array | | |
2. | Creates a one-dimensional Array of the specified Type and length, with zero-based indexing. | | |
3. | Creates a two-dimensional Array of the specified Type and dimension lengths, with zero-based indexing. | | |
4. | Creates a three-dimensional Array of the specified Type and dimension lengths, with zero-based indexing. | | |
5. | Creates a multidimensional Array of the specified Type and dimension lengths, with zero-based indexing. | | |
6. | Creates a multidimensional Array of the specified Type and dimension lengths, with the specified lower bounds. | | |
7. | Bounded array Example | | ![Bounded array Example](http://www.java2s.com/Code/VBImages/BoundedarrayExample.PNG) |
8. | For Each loops through Array | | ![For Each loops through Array](http://www.java2s.com/Code/VBImages/ForEachloopsthroughArray.PNG) |
9. | Two ways to loop through Array | | ![Two ways to loop through Array](http://www.java2s.com/Code/VBImages/TwowaystoloopthroughArray.PNG) |
10. | A simple class to store in the array | | |
11. | Array UBound | | ![Array UBound](http://www.java2s.com/Code/VBImages/ArrayUBound.PNG) |
12. | Set Array Element Value by Index | | |
13. | Array IndexOf and LastIndexOf | | ![Array IndexOf and LastIndexOf](http://www.java2s.com/Code/VBImages/ArrayIndexOfandLastIndexOf.PNG) |
14. | Use Array CreateInstance to Create Array | | ![Use Array CreateInstance to Create Array](http://www.java2s.com/Code/VBImages/UseArrayCreateInstancetoCreateArray.PNG) |
15. | Array Performance Test: One-dimensional array | | ![Array Performance Test: One-dimensional array](http://www.java2s.com/Code/VBImages/ArrayPerformanceTestOnedimensionalarray.PNG) |
16. | Free array's memory | | |
17. | Array Performance Test: SetValue(i, i) | | ![Array Performance Test: SetValue(i, i)](http://www.java2s.com/Code/VBImages/ArrayPerformanceTestSetValueii.PNG) |
18. | Declaring, allocating and initializing arrays | | ![Declaring, allocating and initializing arrays](http://www.java2s.com/Code/VBImages/Declaringallocatingandinitializingarrays.PNG) |
19. | Use For Each/Next to find a minimum grade | | ![Use For Each/Next to find a minimum grade](http://www.java2s.com/Code/VBImages/UseForEachNexttofindaminimumgrade.PNG) |
20. | Reference an Element in an Array by Index | | ![Reference an Element in an Array by Index](http://www.java2s.com/Code/VBImages/ReferenceanElementinanArraybyIndex.PNG) |
21. | Array Upper Bound and Lower Bound | | ![Array Upper Bound and Lower Bound](http://www.java2s.com/Code/VBImages/ArrayUpperBoundandLowerBound.PNG) |
22. | Init an Array in Declaration | | ![Init an Array in Declaration](http://www.java2s.com/Code/VBImages/InitanArrayinDeclaration.PNG) |
23. | Array Length Property | | ![Array Length Property](http://www.java2s.com/Code/VBImages/ArrayLengthProperty.PNG) |
24. | Declare an Array and reference its member | | ![Declare an Array and reference its member](http://www.java2s.com/Code/VBImages/DeclareanArrayandreferenceitsmember.PNG) |
25. | Store your won Class in an Array | | ![Store your won Class in an Array](http://www.java2s.com/Code/VBImages/StoreyourwonClassinanArray.PNG) |
26. | Array Class provides methods for creating, manipulating, searching, and sorting arrays | | |
27. | Copies the last two elements from the Object array to the integer array | | |
28. | Creates and initializes a new three-dimensional Array of type Int32. | | |
29. | Sets a range of elements in the Array to zero, to false, or to Nothing, depending on the element type. | | |
30. | Creates a shallow copy of the Array. | | |
31. | Converts an array of one type to an array of another type. | | |
32. | Copies a range of elements from an Array to another Array | | |
33. | Copies all the elements from one Array to another Array | | |
34. | Performs the specified action on each element of the specified array. | | |
35. | Returns an IEnumerator for the Array. | | |
36. | Reverses the sequence of the elements in the entire one-dimensional Array. | | |
37. | Array.GetLength | | |
38. | Uses GetLowerBound and GetUpperBound in the for loop | | |
39. | Gets value at the specified position in the one-dimensional Array | | |
40. | Reverses the elements in a range | | |