Export (0) Print
Expand All

Boolean.ToString Method

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

Overload List

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

Supported by the .NET Compact Framework.

[Visual Basic] Overloads Overrides Public Function ToString() As String
[C#] public override string ToString();
[C++] public: String* ToString();
[JScript] public override function ToString() : String;

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

Supported by the .NET Compact Framework.

[Visual Basic] Overloads Public Overridable Function ToString(IFormatProvider) As String
[C#] public virtual string ToString(IFormatProvider);
[C++] public: virtual String* ToString(IFormatProvider*);
[JScript] public function ToString(IFormatProvider) : String;

Example

The following code sample illustrates the use of ToString in the context of Boolean:

[Visual Basic, C#, C++] Note   This example shows how to use one of the overloaded versions of ToString. For other examples that might be available, see the individual overload topics.
[Visual Basic] 
Dim raining As Boolean = False
Dim busLate As Boolean = True

Console.WriteLine("raining.ToString() returns {0}", raining)
Console.WriteLine("busLate.ToString() returns {0}", busLate)

[C#] 
bool raining = false;
bool busLate = true;

Console.WriteLine("raining.ToString() returns {0}", raining);
Console.WriteLine("busLate.ToString() returns {0}", busLate);

[C++] 
Boolean raining = false;
Boolean busLate = true;

Console::WriteLine("raining->ToString() returns {0}", __box(raining)->ToString());
Console::WriteLine("busLate->ToString() returns {0}", __box(busLate)->ToString());

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

See Also

Boolean Structure | Boolean Members | System Namespace

Show:
© 2014 Microsoft