string arrays : Array object : Data Structure C# Examples


C# Examples » Data Structure » Array object »

 

string arrays









    
using  System;

class  MainClass
{

    public  static  void  Main()
    {
      
        string[]  stringArray  =  new  string[2];
        Console.WriteLine("stringArray[0]  =  "  +  stringArray[0]);
        stringArray[0]  =  "Hello";
        stringArray[1]  =  "World";
        foreach  (string  myString  in  stringArray)
        {
            Console.WriteLine("myString  =  "  +  myString);
        }

    }

}
    
   
  
   



Output

stringArray[0] =
myString = Hello
myString = World


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Data Structure
» Array object