Convert Char Array to String in C# (6 Ways, .NET 10)

To convert a char array to string in C#, pass the array to the string constructor: new string(chars). It copies every character into a new string in one call.

If you’ve tried chars.ToString() first, you’ve probably seen System.Char[] instead of your text. Arrays don’t override ToString(), so you get the type name.

I ran every option below on .NET 10 with the same six letters, including separators, spans and null arrays.

The Sample char Array We’ll Use

Every example starts from one array, the letters of a Texas city:

char[] city = ['A', 'u', 's', 't', 'i', 'n'];

A few examples also use the state code ['T', 'X'] or the label "Austin, TX".

Method 1: Convert a char Array to String with new string() (Recommended)

I use this one almost every time. Same city array, plus the constructor overload that takes only part of an array:

char[] city = ['A', 'u', 's', 't', 'i', 'n'];
string name = new string(city);
Console.WriteLine(name);

char[] label = "Austin, TX".ToCharArray();
string state = new string(label, 8, 2);   // start at 8, take 2
Console.WriteLine(state);

Output:

Austin
TX
Convert char array to string in C# with new string(city) and new string(label, 8, 2), VS Code terminal output Austin and TX
new string(city) returns Austin; new string(label, 8, 2) returns TX

It prints Austin and TX.

How does this code work?

new string(city) allocates a string of the same length and copies the characters straight in. There’s no loop and no separator logic, which is why it’s the fastest option for a whole array.

new string(label, 8, 2) reads 2 characters starting at index 8 of "Austin, TX". ToCharArray() goes the other way, a bit like when you convert a string to a byte array in C#.

Why Does chars.ToString() Print System.Char[]?

Here’s the mistake I see most. Same array, three ways to print it:

char[] city = ['A', 'u', 's', 't', 'i', 'n'];
Console.WriteLine(city.ToString());    // the bug
Console.WriteLine($"City: {city}");    // same bug
Console.WriteLine(new string(city));   // the fix

Output:

System.Char[]
City: System.Char[]
Austin
C# char array ToString() printing System.Char[] instead of Austin, and new string(city) printing Austin
ToString() and string interpolation both print the type name; new string() prints the text

The first two lines print System.Char[]; only the third prints Austin.

How does this code work?

Arrays inherit Object.ToString(), which returns the type’s full name. Interpolation calls the same method, so $"{city}" has the same bug. My ToString() in C# guide explains which types override it.

Method 2: Convert a char Array with string.Concat()

Use string.Concat when your characters aren’t in an array yet, like a List<char>. Same city array first, then a list:

char[] city = ['A', 'u', 's', 't', 'i', 'n'];
Console.WriteLine(string.Concat(city));

List<char> next = ['D', 'a', 'l', 'l', 'a', 's'];
Console.WriteLine(string.Concat(next));   // any IEnumerable<char>

Output:

Austin
Dallas

Both lines print a city: Austin and Dallas.

How does this code work?

A char[] binds to Concat<T>(IEnumerable<T>), which appends each character. The constructor only accepts an array or span, so Concat saves a ToArray() call on lists and LINQ results.

Method 3: string.Join() for a char Array with a Separator

When you need something between the characters, string.Join is the right tool. Same array, three separators:

char[] city = ['A', 'u', 's', 't', 'i', 'n'];
Console.WriteLine(string.Join("", city));
Console.WriteLine(string.Join("-", city));
Console.WriteLine(string.Join(", ", city));

char[] state = ['T', 'X'];
Console.WriteLine(string.Join('.', state) + ".");

Output:

Austin
A-u-s-t-i-n
A, u, s, t, i, n
T.X.
C# string.Join on a char array with empty, dash and comma separators, plus a char separator for T.X.
string.Join puts the separator between characters, never after the last one

You get Austin, A-u-s-t-i-n, A, u, s, t, i, n and T.X..

How does this code work?

Join writes the separator only between items, so I add the final period myself. The '.' overload takes a char separator.

The same call joins strings too; see how to convert a list to a comma-separated string.

Method 4: StringBuilder.Append(char[]) for Building Text

If the char array is one piece of a bigger string, append it to a StringBuilder. Same city array, plus the state code:

using System.Text;

char[] city = ['A', 'u', 's', 't', 'i', 'n'];
char[] state = ['T', 'X'];

var sb = new StringBuilder();
sb.Append(city).Append(", ").Append(state);
Console.WriteLine(sb.ToString());

sb.Clear().Append(city, 0, 3);   // first 3 chars only
Console.WriteLine(sb.ToString());

Output:

Austin, TX
Aus

It prints Austin, TX, then Aus.

How does this code work?

Append(char[]) adds the whole array, and Append(char[], 0, 3) adds 3 characters from index 0.

For a single conversion, the builder is extra work. It pays off in loops; here’s the difference between string and StringBuilder.

Method 5: new string(ReadOnlySpan<char>) and string.Create

Spans let you convert part of an array without copying it to a smaller array first. Same city array again:

char[] city = ['A', 'u', 's', 't', 'i', 'n'];
ReadOnlySpan<char> first = city.AsSpan(0, 3);
Console.WriteLine(new string(first));
Console.WriteLine(new string(city.AsSpan()[^3..]));

string upper = string.Create(city.Length, city, (span, src) =>
{
    for (int i = 0; i < src.Length; i++)
        span[i] = char.ToUpperInvariant(src[i]);
});
Console.WriteLine(upper);

Output:

Aus
tin
AUSTIN
C# new string from ReadOnlySpan<char> slices Aus and tin, and string.Create writing AUSTIN, VS Code output
Span slices convert part of the array; string.Create fills the new string directly

The output is Aus, tin and AUSTIN.

How does this code work?

city.AsSpan(0, 3) is a view over the first three characters, and [^3..] is the last three. new string(span) copies only that slice.

string.Create hands you the new string’s buffer, so you can transform characters while copying. That’s how I’d uppercase or reverse a string in C# without an extra array.

Method 6: Convert a LINQ char Sequence to a String

LINQ queries on a string return IEnumerable<char>, not a string. Here’s a city, state and ZIP code label:

string raw = "Austin, TX 78701";
IEnumerable<char> letters = raw.Where(char.IsLetter);
Console.WriteLine(string.Concat(letters));

string zip = string.Concat(raw.Where(char.IsDigit));
Console.WriteLine(zip);

char[] city = ['A', 'u', 's', 't', 'i', 'n'];
Console.WriteLine(city.Aggregate("", (s, c) => s + c));   // works, but slow

Output:

AustinTX
78701
Austin

Letters give AustinTX, digits give 78701, and Aggregate rebuilds Austin.

How does this code work?

string.Concat(letters) reads the sequence directly.

Important: Aggregate creates a new string on every step, so avoid it on long input. To strip characters instead, see how to remove a particular character from a string.

How to Handle a null or Empty char Array

Arrays from files or APIs can be null. Same conversions, run on a null array and an empty one:

using System.Text;

char[]? missing = null;
char[] empty = [];
Console.WriteLine($"ctor null:   [{new string(missing)}]");
Console.WriteLine($"ctor empty:  [{new string(empty)}]");
Console.WriteLine($"Append null: [{new StringBuilder().Append(missing)}]");
Console.WriteLine($"Concat ??:   [{string.Concat(missing ?? [])}]");
try
{
    Console.WriteLine(string.Concat(missing!));
}
catch (ArgumentNullException ex)
{
    Console.WriteLine($"Concat null: {ex.GetType().Name}");
}

Output:

ctor null:   []
ctor empty:  []
Append null: []
Concat ??:   []
Concat null: ArgumentNullException
C# null and empty char array to string: new string returns empty, Append ignores null, string.Concat throws ArgumentNullException
The constructor and StringBuilder return an empty string; string.Concat(null) throws

Four lines print []; the last prints Concat null: ArgumentNullException.

How does this code work?

new string(null) returns String.Empty, and Append(null) adds nothing. Concat and Join throw, so guard them with missing ?? [].

To test the result, use string.IsNullOrEmpty; see how to check if a string is not null or empty in C#.

Which Method Should You Use to Convert a char Array to String?

SituationUseWhy
Whole char[] to stringnew string(chars)Fastest, null-safe
Part of an arraynew string(chars, start, length) or a spanNo extra array
List<char> or LINQ resultstring.Concat(seq)Takes any IEnumerable<char>
Separator between charactersstring.Join(“-“, chars)Adds it between items only
Array is part of a bigger stringStringBuilder.Append(chars)Chains with other text
Transform while copyingstring.CreateWrites into the new string

Things to Keep in Mind

  • Never call ToString() on a char[]. It returns System.Char[]; use new string(chars).
  • null behaves differently per method. The constructor returns an empty string; Concat and Join throw.
  • Check start + length. The partial overloads throw ArgumentOutOfRangeException past the end.

Working with single characters next? These posts pick up from here:

Frequently Asked Questions

How do I convert a char array to a string in C#?

Pass it to the string constructor: string s = new string(chars);. It copies every character and returns an empty string if the array is null or empty.

Why does ToString() on a char array return System.Char[]?

Arrays don’t override ToString(), so they return their type name. Use new string(chars) or string.Concat(chars) instead.

Which is faster, new string() or string.Join()?

new string(chars) is faster. string.Join is built for separators, so use it only when you need one.

How do I convert part of a char array to a string?

Use new string(chars, startIndex, length) or new string(chars.AsSpan(start, length)). Both overloads are listed in the String constructor reference on Microsoft Learn.

How do I convert a List<char> to a string in C#?

Call string.Concat(list), which accepts any IEnumerable<char>.