.NET / C - Convert char to string
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
In C#, converting a char to a string is simple, but the exact method depends on whether you have a single character or a full char[]. Many short answers blur those two cases together, which is why developers sometimes reach for the wrong API.
Convert a Single char
For one character, the most direct approach is ToString():
This produces a new string containing exactly one character. It is readable, idiomatic, and usually the best choice when you already have a char.
Another valid option is Convert.ToString(letter):
That is useful when you are already writing conversion-heavy code and want a uniform style, but for a plain char, ToString() is usually clearer.
Create a string from a char[]
If the input is a character array, use the string constructor:
This is a different problem from converting a single char. The constructor copies the contents of the array into a new immutable string.
You can also build a string from part of an array:
That example prints 8.0 by starting at index 3 and taking three characters.
When string.Concat Is Appropriate
string.Concat also works with char[]:
This is valid, but it is usually less explicit than new string(chars) when the source is already a character array. The constructor communicates intent better: you are creating a string from characters, not concatenating several separate values.
Understand Immutability
A key detail in .NET is that strings are immutable. Changing the original array after conversion does not change the string you created:
The first Console.WriteLine still prints cat. The second prints bat. This matters when you work with buffers, parsers, or security-sensitive code where mutable character data and immutable strings behave differently.
Converting While Parsing Input
A common real-world case is walking through a string or buffer one character at a time and selectively turning characters into strings for formatting or APIs that only accept string:
This is clearer than wrapping each character in a one-element array just to call the string constructor.
Special Characters Work the Same Way
Escape characters are still ordinary char values and can be converted the same way:
The resulting string has length 1 even though printing it may look unusual because the character controls formatting.
Common Pitfalls
- Mixing up a single
charwith achar[]and usingnew string(value)on the wrong type. - Using
string.Joinfor simple character conversion, which adds unnecessary complexity. - Forgetting that strings are immutable and expecting later
char[]changes to affect the created string. - Creating one-element arrays just to convert a single character when
ToString()is simpler. - Misreading special characters such as
'\n'or'\t'because their output affects the console display.
Summary
- Use
charValue.ToString()for a singlechar. - Use
new string(charArray)when the input is achar[]. - Prefer the string constructor over
string.Concatwhen converting a character array directly. - Remember that the resulting string is immutable and independent from the original array.
- Choose the API that matches the actual input type instead of treating
charandchar[]as the same problem.

