Initialize string arrays : String Array « String « C# / CSharp Tutorial






using System;

class MainClass
{
  public static void Main()
  {
    string[] stringArray = {"Hello", "World"};
    foreach (string myString in stringArray)
    {
      Console.WriteLine("myString = " + myString);
    }
  }
}
myString = Hello
myString = World








5.5.String Array
5.5.1.Initialize string arrays
5.5.2.Change element in a string array
5.5.3.Use the Sort() method to sort the elements in a string array
5.5.4.A two-dimensional rectangular string array