Construct string from char array : String Creation : String C# Examples


C# Examples » String » String Creation »

 

Construct string from char array









    
using  System;  
  
class  MainClass  {    
    public  static  void  Main()  {    
  
        char[]  charray  =  {'A',  '  ',  's',  't',  'r',  'i',  'n',  'g',  '.'  };  
        string  str1  =  new  string(charray);  
        string  str2  =  "Another  string.";  
  
        Console.WriteLine(str1);  
        Console.WriteLine(str2);  
    }    
}
    
   
  
   



Output

A string.
Another string.


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo String
» String Creation