Initialize string arrays : String Array : String C# Examples


C# Examples » String » String Array »

 

Initialize string arrays









    
using  System;

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



Output

myString = Hello
myString = World


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo String
» String Array