toString

Returns a string representing the specified object.

Applies to:

Boolean

Syntax

toString()

Parameters

None

Description

Every object has a toString method that is automatically called when it is to be represented as a text value or when an object is referred to in a string concatenation.

You can use toString within your own code to convert an object into a string, and you can create your own function to be called in place of the default toString method.

For Boolean objects and values, the built-in toString method returns "true" or "false" depending on the value of the boolean object.

flag.toString returns "true".
flag = new Boolean(true)
Console.Write("flag.toString() is " + flag.toString())

For information on defining your own toString method, see the Object: toString method.