Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to use the GetLowerBound method of array class in C#
The GetLowerBound() method of array class in C# gets the lower bound of the specified dimension in the Array.
Firstly, set the array and get the lower bound as shown below −
arr.GetLowerBound(0).ToString()
The following is an example stating the usage of GetLowerBound() method in C#.
Example
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace lower {
class Program {
static void Main(string[] args) {
Array arr = Array.CreateInstance(typeof(String), 3);
arr.SetValue("Car", 0);
arr.SetValue("Truck", 1);
arr.SetValue("Motorbike", 2);
Console.WriteLine("Lower Bound {0}",arr.GetLowerBound(0).ToString());
Console.ReadLine();
}
}
}
Output
Lower Bound 0
Advertisements