Boolean

Summary

The wrapper class for the bool primitive type.

Description

System.Boolean is the wrapper class for the bool primitive type.

Booleans can have one of two possible values: true or false.

Examples

Instantiation
1
2
3
import System;
 
System.Boolean myBoolean = new System.Boolean(true);
Auto-boxing
1
2
3
import System;
 
System.Boolean myBoolean = true;
Primitives Only
1
2
bool a = true;
bool b = false;

Methods

  • Boolean (Constructor)

    Constructs a System.Boolean object.

  • compare

    Compares the Boolean object to another Boolean object.

  • FALSE

    The primitive Boolean value false.

  • fromString

    Converts a string to a bool value.

  • fromStringOr

    Converts a string to its equivalent bool value or the provided default value if the conversion fails.

  • fromStringOrThrow

    Converts a string to a valid bool value or throws an exception if the value cannot be converted.

  • toExternal

    Converts the Boolean value to its equivalent external value.

  • toString

    Returns a string representation of the Boolean value.

  • TRUE

    The primitive Boolean value true.

  • valueOf

    Returns the primitive Boolean value wrapped by the System.Boolean object.

Share

HTML | BBCode | Direct Link