Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Whats the use of GetLowerBound()?

The lowerbound of an array is always zero in VB.net, even if the first element is set to Nothing. So why do we need to use GetLowerBound(dimension) to get the index of the first element of an array in a particular dimension?

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

As per documentation found here:
https://docs.microsoft.com/en-us/dotnet/api/system.array.getlowerbound?view=net-6.0

There can be arrays that do not start with index 0:

Note that, although most arrays in .NET are zero-based (that is, the
GetLowerBound method returns zero for each dimension of an array),
.NET does support arrays that are not zero-based. Such arrays can be
created with the CreateInstance(Type, Int32[], Int32[]) method, and
can also be returned from unmanaged code.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading