Let us first set an array of 5 characters −
char[] ch = new char[15]; ch[0] = 'T'; ch[1] = 'r'; ch[2] = 'i'; ch[3] = 'c'; ch[4] = 'k';
Now convert them into a string −
string str = new string(ch);
Here is the complete code −
Example
Using System;
class Program {
static void Main() {
char[] ch = new char[15];
ch[0] = 'T';
ch[1] = 'r';
ch[2] = 'i';
ch[3] = 'c';
ch[4] = 'k';
// converting to string
string str = new string(ch);
Console.WriteLine(str);
}
}