Different Ways to Convert Char Array to String in C#
Last Updated :
15 Jul, 2025
We have given a character array arr and the task is to convert char array to string str in C#.
Input: arr = [s, t, r, i, n, g]
Output: string
Input: arr = [G, e, e, k, s, F, o, r, G, e, e, k, s]
Output: GeeksForGeeks
In order to do this task, we have the following methods:
Method 1:
Using string() Method: The String class has several overloaded constructors which take an array of characters or bytes. Thus it can be used to create a new string from the character array.
Syntax:
string str = new string(character_array);
Example:
C#
// C# program to convert the
// char array to string
using System;
using System.Text;
public class GFG{
static string getString(char[] arr)
{
// string() is a used to
// convert the char array
// to string
string s = new string(arr);
return s;
}
static void Main(string[] args)
{
// given character array
char[] arr = {'G', 'e', 'e', 'k',
's', 'F', 'o', 'r', 'G', 'e',
'e', 'k', 's'};
// function calling
string str = getString(arr);
// printing output
Console.WriteLine(str);
}
}
Output:
GeeksForGeeks
Method 2:
Using Join() Method: This method is used to concatenates the members of a collection or the elements of the specified array, using the specified separator between each member or element. Thus it can be used to create a new string from the character array.
Syntax:
string str = string.Join("", character_array);
Example:
C#
// C# program to convert the
// char array to string
using System;
using System.Text;
public class GFG{
static string getString(char[] arr)
{
// String.Join() is a used to
// convert the char array
// to string
string s = string.Join("", arr);
return s;
}
static void Main(string[] args)
{
// given character array
char[] arr = {'G', 'e', 'e', 'k',
's', 'F', 'o', 'r', 'G', 'e',
'e', 'k', 's'};
// function calling
string str = getString(arr);
// printing output
Console.WriteLine(str);
}
}
Output:
GeeksForGeeks
Method 3:
Using Concat() Method: This method is used to concatenate one or more instances of String or the String representations of the values of one or more instances of Object. Thus it can be used to create a new string from the character array.
Syntax:
string str = string.Concat(character_array);
Example:
C#
// C# program to convert the
// char array to string
using System;
using System.Text;
public class GFG{
static string getString(char[] arr)
{
// String.Concat() is a used to
// convert the char array
// to string
string s = string.Concat(arr);
return s;
}
static void Main(string[] args)
{
// given character array
char[] arr = {'G', 'e', 'e', 'k',
's', 'F', 'o', 'r', 'G', 'e',
'e', 'k', 's'};
// function calling
string str = getString(arr);
// printing output
Console.WriteLine(str);
}
}
Output:
GeeksForGeeks
Similar Reads
Convert a Character to the String in C# Given a character, the task is to character to the string in C#. Examples: Input : X = 'a' Output : string S = "a" Input : X = 'A' Output : string S = "A" Approach: The idea is to use ToString() method, the argument is the character and it returns string converting Unicode character to the string. /
1 min read
Converting a String to its Equivalent Byte Array in C# Given a string, the task is to convert this string into a Byte array in C#. Examples: Input: aA Output: [97, 65 ] Input: Hello Output: [ 72, 101, 108, 108, 111 ] Method 1: Using ToByte() Method: This method is a Convert class method. It is used to converts other base data types to a byte data type.
3 min read
Different Methods to Read a Character in C# In C#, we know that Console.Read() method is used to read a single character from the standard output device. And also there are different methods available to read the single character. Following methods can be used for this purpose: Console.ReadLine()[0] MethodConsole.ReadKey().KeyChar MethodChar.
3 min read
C# | Char.ConvertToUtf32(String, Int32) Method This method is used to converts the value of a UTF-16 encoded character or surrogate pair at a specified position in a string into a Unicode code point. Syntax: public static int ConvertToUtf32 (string s, int index); Parameters: s: A string that contains a character or surrogate pair. index: The ind
3 min read
C# | Convert.ToChar(String, IFormatProvider) Method This method is used to convert the value of the specified object to its equivalent Unicode character, using the specified culture-specific formatting information. Syntax: public static char ToChar (object value, IFormatProvider provider); Parameters: value: It is an string of length 1 or null. provi
3 min read
C# | Convert Stack to array Stack represents a last-in, first out collection of object. It is used when you need a last-in, first-out access of items. When you add an item in the list, it is called pushing the item and when you remove it, it is called popping the item. Stack<T>.ToArray Method is used to copy a Stack<T
2 min read