C# Array GetValue(Int64[]) Array
Description
Array GetValue(Int64[])
gets the value at the specified
position in the multidimensional Array. The indexes are specified as an
array of 64-bit integers.
Syntax
Array.GetValue(Int64[])
has the following syntax.
[ComVisibleAttribute(false)]
public Object GetValue(
params long[] indices
)
Parameters
Array.GetValue(Int64[])
has the following parameters.
indices
- A one-dimensional array of 64-bit integers that represent the indexes specifying the position of the Array element to get.
Returns
Array.GetValue(Int64[])
method returns The value at the specified position in the multidimensional Array.
Example
The following code example demonstrates how to set and get a specific value in a one-dimensional or multidimensional array.
using System;//from w ww . j av a2 s .co m
public class SamplesArray {
public static void Main() {
// Creates and initializes a seven-dimensional array.
String[,,,,,,] myArr7 = new String[5,5,5,5,5,5,5];
int[] myIndices = new int[7] { 1, 2, 3, 0, 1, 2, 3 };
myArr7.SetValue( "one-two-three-zero-one-two-three", myIndices );
Console.WriteLine( "[1,2,3,0,1,2,3]: {0}", myArr7.GetValue( myIndices ) );
}
}
The code above generates the following result.