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.
ExamplesThe 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"
}
}
open System
let ch = 'a'
printfn $"{ch.ToString()}" // Output: "a"
printfn $"{Char.ToString 'b'}" // Output: "b"
Module ToStringSample
Sub Main()
Dim ch As Char
ch = "a"c
Console.WriteLine(ch.ToString()) ' Output: "a"
Console.WriteLine(Char.ToString("b"c)) ' Output: "b"
End Sub
End Module
ToString(IFormatProvider)
Converts the value of this instance to its equivalent string representation using the specified culture-specific format information.
public:
virtual System::String ^ ToString(IFormatProvider ^ provider);
public string ToString(IFormatProvider? provider);
public string ToString(IFormatProvider provider);
override this.ToString : IFormatProvider -> string
Public Function ToString (provider As IFormatProvider) As String
Parameters
(Reserved) An object that supplies culture-specific formatting information.
ReturnsThe string representation of the value of this instance as specified by provider
.
The provider
parameter is ignored; it does not participate in this operation.
Converts the specified Unicode character to its equivalent string representation.
public:
static System::String ^ ToString(char c);
public static string ToString(char c);
static member ToString : char -> string
Public Shared Function ToString (c As Char) As String
Parameters
The Unicode character to convert.
ReturnsThe string representation of the value of c
.
Converts the value of this instance to its equivalent string representation.
public:
override System::String ^ ToString();
public override string ToString();
override this.ToString : unit -> string
Public Overrides Function ToString () As String
Returns
The string representation of the value of this instance.
See alsoCollaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide. In this articleWas this page helpful?
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4