Share via


GetValue Method

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Gets the value at the specified position in the one-dimensional Array. The index is specified as a 32-bit integer.

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

Syntax

'Declaration
Public Function GetValue ( _
    index As Integer _
) As Object
public Object GetValue(
    int index
)
public:
Object^ GetValue(
    int index
)
member GetValue : 
        index:int -> Object 
public function GetValue(
    index : int
) : Object

Parameters

Return Value

Type: System. . :: . .Object
The value at the specified position in the one-dimensional Array.

Exceptions

Exception Condition
ArgumentException

The current Array does not have exactly one dimension.

IndexOutOfRangeException

index is outside the range of valid indexes for the current Array.

Remarks

The GetLowerBound and GetUpperBound methods can determine whether the value of index is out of bounds.

This method is an O(1) operation.

.NET Framework Security

See Also

Reference

Array Class

System Namespace