Set a value at the specified position in the one-dimensional Array in CSharp
Description
The following code shows how to set a value at the specified position in the one-dimensional Array.
Example
//from w ww . ja v a2 s . c o m
using System;
public class SamplesArray {
public static void Main() {
String[] myArr1 = new String[5];
// Sets the element at index 3.
myArr1.SetValue( "three", 3 );
Console.WriteLine( "[3]: {0}", myArr1.GetValue( 3 ) );
}
}
The code above generates the following result.