Construct string from char array : String Creation « String « C# / CSharp Tutorial






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); 
  }  
}
A string.
Another string.








5.4.String Creation
5.4.1.Construct string from char array