Get the value at the specified position in the one-dimensional Array in CSharp

Description

The following code shows how to get the value at the specified position in the one-dimensional Array.

Example


using System;//ww w .j  ava  2s  .  com

public class SamplesArray  {

   public static void Main()  {
      String[] myArr1 = new String[5];

      myArr1.SetValue( "three", 3 );
      Console.WriteLine( "[3]:   {0}", myArr1.GetValue( 3 ) );
   }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    Data Types »




C# Data Types
Bool
Byte
Char
Decimal
Double
Float
Integer
Long
Short
String
C# Array
Array Example
Byte Array
C# Standard Data Type Format
BigInteger
Complex
Currency
DateTime
DateTimeOffset
DateTime Format Parse Convert
TimeSpan
TimeZone
Enum
Null
tuple
var