C# Array GetLongLength

Description

Array GetLongLength gets a 64-bit integer that represents the number of elements in the specified dimension of the Array.

Syntax

Array.GetLongLength has the following syntax.


[ComVisibleAttribute(false)]
public long GetLongLength(
  int dimension
)

Parameters

Array.GetLongLength has the following parameters.

  • dimension - A zero-based dimension of the Array whose length needs to be determined.

Returns

Array.GetLongLength method returns A 64-bit integer that represents the number of elements in the specified dimension.

Example


using System;/*from   www.  j  ava2s.  c  om*/

public class SamplesArray
{
    public static void Main()
    {
        Array MyArray1 = Array.CreateInstance(typeof(int), 5);
        Console.WriteLine( MyArray1.GetLongLength(1));
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version