.NET / C# - Convert char[] to string .NET / C# - Convert char[] to string arrays arrays

.NET / C# - Convert char[] to string


There's a constructor for this:

char[] chars = {'a', ' ', 's', 't', 'r', 'i', 'n', 'g'};string s = new string(chars);


Use the constructor of string which accepts a char[]

char[] c = ...;string s = new string(c);


char[] characters;...string s = new string(characters);