Gets the value at the specified position in the current one-dimensional
instance.
[Edit]
Parameters
- index
- A int that contains the position of the value to get from the current instance.
[Edit]
Returns
A object that contains the value at the specified position in the current
instance.
[Edit]
Exceptions
Remarks
Example
This example demonstrates the Array.GetValue(Int32[]) method.
C# Example |
using System;
public class ArrayGetValueExample {
public static void Main() {
String[] strAry = { "one", "two", "three", "four", "five" };
Console.Write( "The elements of the array are: " );
for( int i = 0; i < strAry.Length; i++ )
Console.Write( " '{0}' ", strAry.GetValue( i ) );
}
}
|
The output is
The elements
of the array are: 'one' 'two' 'three' 'four' 'five'
Requirements
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0