![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
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
What is the Length property of BitArray class in C#?
The length property is used to gets or sets the number of elements in the BitArray.
Our BitArray.
BitArray arr = new BitArray( 5 );
To calculate the length, use the length property.
Console.WriteLine( "Length: {0}", arr.Length );
You can try to run the following code to learn how to work with Length property of BitArray class.
Example
using System; using System.Collections; public class Demo { public static void Main() { BitArray arr = new BitArray( 5 ); Console.WriteLine( "Count: {0}", arr.Count ); Console.WriteLine( "Length: {0}", arr.Length ); } }
Output
Count: 5 Length: 5
Advertisements