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:
xxxxxxxxxx
1
char character = 'x';
2
var result = character.ToString();
In this section, we present full example of using the Char.ToString()
method to convert a character to a string.
xxxxxxxxxx
1
using System;
2
3
public class TestClass
4
{
5
public static void Main()
6
{
7
char character = 'x';
8
var result = character.ToString();
9
10
Console.WriteLine(result.GetType());
11
}
12
}
Output:
xxxxxxxxxx
1
System.String