Char.ToString Method (IFormatProvider)

May 11, 2014

Converts the value of this instance to its equivalent string representation using the specified culture-specific format information.

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

public string ToString(
	IFormatProvider provider
)

Parameters

provider
Type: System.IFormatProvider
(Reserved) An IFormatProvider that supplies culture-specific formatting information.

Return Value

Type: System.String
The string representation of the value of this instance as specified by provider.

Implements

IConvertible.ToString(IFormatProvider)

The provider parameter is ignored; it does not participate in this operation.

The following example demonstrates an overload of ToString.


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"
   }
}


Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2014 Microsoft