BitArray.Get Method (Int32)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets the value of the bit at a specific position in the BitArray.

Namespace:   System.Collections
Assembly:  mscorlib (in mscorlib.dll)

member Get : 
        index:int -> bool


Type: System.Int32

The zero-based index of the value to get.

Return Value

Type: System.Boolean

The value of the bit at position index.

Exception Condition

index is less than zero.


index is greater than or equal to the number of elements in the BitArray.

This method is an O(1) operation.

The following code example shows how to set and get specific elements in a BitArray.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top