Swapping Data between Positions in an Array : Array Index « Data Structure « C# / CSharp Tutorial






class MainClass
{
  static void Main()
  {

    string[] languages = new string[9]{"C#", "COBOL", "Java","C++"};

    string language = languages[3];
    languages[3] = languages[2];
    languages[2] = language;

  }
}








11.2.Array Index
11.2.1.Set array element value by index(subscript)
11.2.2.Demonstrate an array overrun
11.2.3.Assigning array reference variables
11.2.4.Use the IndexOf() and LastIndexOf() methods to find the value 1 in intArray
11.2.5.Use the IndexOf() and LastIndexOf() methods to find the string 'Hello' in stringArray
11.2.6.Swapping Data between Positions in an Array