Leer en inglés Editar

Compartir a través de


Char.ToString Method

Definition

Converts the value of this instance to its equivalent string representation.

Overloads

ToString(IFormatProvider)

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

ToString(Char)

Converts the specified Unicode character to its equivalent string representation.

ToString()

Converts the value of this instance to its equivalent string representation.

Examples

The following code example demonstrates ToString.

using System;

public class ToStringSample {
    public static void Main() {
        char ch = 'a';
        Console.WriteLine(ch.ToString());		// Output: "a"

        Console.WriteLine(Char.ToString('b'));	// Output: "b"
    }
}

ToString(IFormatProvider)

Source:
Char.cs
Source:
Char.cs
Source:
Char.cs

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

public string ToString (IFormatProvider? provider);
public string ToString (IFormatProvider provider);

Parameters

provider
IFormatProvider

(Reserved) An object that supplies culture-specific formatting information.

Returns

The string representation of the value of this instance as specified by provider.

Implements

Remarks

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

See also

Applies to

ToString(Char)

Source:
Char.cs
Source:
Char.cs
Source:
Char.cs

Converts the specified Unicode character to its equivalent string representation.

public static string ToString (char c);

Parameters

c
Char

The Unicode character to convert.

Returns

The string representation of the value of c.

See also

Applies to

ToString()

Source:
Char.cs
Source:
Char.cs
Source:
Char.cs

Converts the value of this instance to its equivalent string representation.

public override string ToString ();

Returns

The string representation of the value of this instance.

See also

Applies to