System.Array.Length Property

Gets a 32-bit integer that represents the total number of elements in all the dimensions of the Array.

Syntax

[get: System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)]
public int Length { get; }

Value

A int that contains the total number of elements in all the dimensions of the current instance.

Remarks

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

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0