types.Bool.tostring
Method on every
boolpure tostring(): any
Converts the bool to its string form.
Return value
The literal word "true" or "false" - not "1"/"0", unlike tointeger.
Notes
Takes no arguments; see types.Integer.tostring for the shared arity error. null has no tostring method to compare against: it is not callable as a method, only formatted implicitly (as "null") when the VM converts it for print or string concatenation.
Example
println("true.tostring() =", true.tostring())
println("false.tostring() =", false.tostring())
println("type(true.tostring()) =", type(true.tostring()))Output:
true.tostring() = true
false.tostring() = false
type(true.tostring()) = stringSee also
tostring | Converts the integer to its decimal string form. |
tostring | Converts the float to its string form. |
tointeger | Converts the bool to an integer. |
| bool | class index |