C# BitArray Count

Description

BitArray Count gets the number of elements contained in the BitArray.

Syntax

BitArray.Count has the following syntax.


public int Count { get; }

Example


using System;//  ww  w .  ja v  a 2  s .c o m
using System.Collections;
public class SamplesBitArray  {
   public static void Main()  {
      BitArray myBA = new BitArray( new byte[]{0,0,0,1} );
      myBA[0] = true;
      Console.WriteLine(myBA.Count);
   }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Collections »




ArrayList
BitArray
Comparer
Hashtable
Queue
SortedList
Stack