Export (0) Print
Expand All

BitArray::Length Property

Gets or sets the number of elements in the BitArray.

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

public:
property int Length {
	int get ();
	void set (int value);
}

Property Value

Type: System::Int32
The number of elements in the BitArray.

ExceptionCondition
ArgumentOutOfRangeException

The property is set to a value that is less than zero.

Length and Count return the same value. Length can be set to a specific value, but Count is read-only.

If Length is set to a value that is less than Count, the BitArray is truncated and the elements after the index value -1 are deleted.

If Length is set to a value that is greater than Count, the new elements are set to false.

Retrieving the value of this property is an O(1) operation. Setting this property is an O(n) operation.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

XNA Framework

Supported in: 3.0, 2.0, 1.0

Portable Class Library

Supported in: Portable Class Library

Supported in: Windows Phone 8.1

Supported in: Windows Phone Silverlight 8.1

Supported in: Windows Phone Silverlight 8
Show:
© 2015 Microsoft