O'Reilly logo

C# in a Nutshell by Peter Drayton, Ted Neward, Ben Albahari

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

Boolean

Synopsis

This is a simple value type that contains either true or false. When converting to or from a string or comparing with a string, the TrueString and FalseString fields are used (these return True and False). This type is available in C# through the bool alias.

public struct Boolean : IComparable, IConvertible {
// Public Static Fields
   public static readonly field string FalseString;              // =False
   public static readonly field string TrueString;               // =True
                  // Public Static Methods
   public static method bool Parse(string value);  
// Public Instance Methods
   public method int CompareTo(object obj);                     // implements IComparable
   public override method bool Equals(object obj);              // overrides ValueType
   public override method int GetHashCode();                     // overrides ValueType
   public method TypeCode GetTypeCode();                         // implements IConvertible
   public override method string ToString();                     // overrides ValueType
   public method string ToString(IFormatProvider provider);     // implements IConvertible
}

Hierarchy

ObjectValueTypeBoolean(IComparable, IConvertible)

Returned By

Multiple types

Passed To

Multiple types

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required