EN
C# / .NET - convert char to string
0
points
In this article, we would like to show you how to convert char to string in C#.
Quick solution:
char character = 'x';
var result = character.ToString();
Practical example
In this section, we present full example of using the Char.ToString() method to convert a character to a string.
using System;
public class TestClass
{
public static void Main()
{
char character = 'x';
var result = character.ToString();
Console.WriteLine(result.GetType());
}
}
Output:
System.String