Creating Strings from char array : Chars in String : String C# Examples


C# Examples » String » Chars in String »

 

Creating Strings from char array









    
using  System;

class  MainClass
{
    static  void  Main(string[]  args)
    {
        char[]  MyChar2  =  {'H','e','l','l','o','\0'};

        char[]  MyChar3  =  new  char[6];

        MyChar3[0]  =  'H';
        MyChar3[1]  =  'e';
        MyChar3[2]  =  'l';
        MyChar3[3]  =  'l';
        MyChar3[4]  =  'o';
        MyChar3[5]  =  '\0';
        
        Console.WriteLine(MyChar3);
        Console.WriteLine(MyChar2);
    }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo String
» Chars in String