- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- 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 ToString() method of array in C#?
The ToString() method returns a string that represents the current object.
In the below example, we have used the ToString() method with another Array class method.
arr.GetLowerBound(0).ToString()
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("One", 0); arr.SetValue("Two", 1); Console.WriteLine("Lower Bound {0}",arr.GetLowerBound(0).ToString()); Console.ReadLine(); } } }
Output
Lower Bound 0
Advertisements