C# BitArray Item
Description
BitArray Item
gets or sets the value of the bit at a specific
position in the BitArray.
Syntax
BitArray.Item
has the following syntax.
public bool this[
int index
] { get; set; }
Parameters
BitArray.Item
has the following parameters.
index
- The zero-based index of the value to get or set.
Example
/*from www .ja v 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} );
myBA[0] = true;
Console.WriteLine(myBA[0]);
}
}
The code above generates the following result.