Array methods
how to use GetLowerbound method of Array class?
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
VulpesRank #55 · 29.2K reputationPosted Jul 3, 2013, 2:33 AM EDT
using System;
class Test
{
static void Main()
{
int[,] ia = new int[2,2];
int lb1 = ia.GetLowerBound(0); // dimension 1
int lb2 = ia.GetLowerBound(1); // dimension 2
Console.WriteLine(lb1); // 0
Console.WriteLine(lb2); // 0
Console.ReadKey();
}
}
Notice that you can't create an array with a lower bound other than 0 using normal C# array syntax. You have to use the Array.CreateInstance method if you want to do this.