Char.ToString Method (Char)

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Converts the specified Unicode character to its equivalent string representation.

Namespace: System
Assembly: mscorlib (in mscorlib.dll)

Syntax

Public Shared Function ToString ( _
    c As Char _
) As String
public static string ToString(
    char c
)

Parameters

Return Value

Type: System..::.String
The string representation of the value of c.

Examples

The following example demonstrates ToString.


Module Example

   Public Sub Demo(ByVal outputBlock As System.Windows.Controls.TextBlock)

      Dim ch As Char
      ch = "a"c
      outputBlock.Text &= ch.ToString() & vbCrLf        ' Output: "a"

      outputBlock.Text &= Char.ToString("b"c) & vbCrLf  ' Output: "b"

   End Sub

End Module
using System;

public class Example
{
   public static void Demo(System.Windows.Controls.TextBlock outputBlock)
   {
      char ch = 'a';
      outputBlock.Text += ch.ToString() + "\n";     // Output: "a"

      outputBlock.Text += Char.ToString('b') + "\n";    // Output: "b"
   }
}

Version Information

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Platforms

Windows Phone

See Also

Reference

Char Structure

ToString Overload

System Namespace

String