Get or set the number of elements in the BitArray in CSharp

Description

The following code shows how to get or set the number of elements in the BitArray.

Example


/*from w w w .j  av a  2  s  .c  om*/

using System;
using System.Collections;
public class SamplesBitArray  {
   public static void Main()  {
      BitArray myBA = new BitArray( new byte[]{0,0,0,1} );

      Console.WriteLine(myBA.Length);
   }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    Collections »




ArrayList
BitArray
Collection
Comparer
HashSet
Hashtable
LinkedList
List
ListDictionary
OrderedDictionary
Queue
SortedList
SortedSet
Stack
StringCollection
StringDictionary