Create BitArray from another BitArray in CSharp

Description

The following code shows how to create BitArray from another BitArray.

Example


/*from   ww  w.ja v  a2s .co m*/
using System;
using System.Collections;
public class SamplesBitArray  {
   public static void Main()  {
      BitArray myBA = new BitArray( new int[]{0,0,0,1} );
      BitArray myBA1 = new BitArray( myBA );
      
      Console.WriteLine(myBA1.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