How do I convert a single char to a string?
Use the .ToString() Method
String myString = "Hello, World";
foreach (Char c in myString)
{
String cString = c.ToString();
}
With C# 6 interpolation:
char ch = 'A';
string s = $"{ch}";
This shaves a few bytes. :)
You have two options. Create a string
object or call ToString
method.
String cString = c.ToString();
String cString2 = new String(c, 1); // second parameter indicates
// how many times it should be repeated