Boolean Struct (System) (original) (raw)
- Reference
Definition
Represents a Boolean (true
or false
) value.
public value class bool : IComparable, IComparable<bool>, IConvertible, IEquatable<bool>
public value class bool : IComparable, IComparable<bool>, IConvertible, IEquatable<bool>, IParsable<bool>, ISpanParsable<bool>
public value class bool : IComparable, IConvertible
public value class bool : IComparable, IComparable<bool>, IEquatable<bool>
public struct Boolean : IComparable, IComparable<bool>, IConvertible, IEquatable<bool>
public readonly struct Boolean : IComparable, IComparable<bool>, IConvertible, IEquatable<bool>, IParsable<bool>, ISpanParsable<bool>
public readonly struct Boolean : IComparable, IComparable<bool>, IConvertible, IEquatable<bool>
[System.Serializable]
public struct Boolean : IComparable, IConvertible
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public struct Boolean : IComparable, IComparable<bool>, IConvertible, IEquatable<bool>
public struct Boolean : IComparable, IComparable<bool>, IEquatable<bool>
type bool = struct
interface IConvertible
type bool = struct
interface IConvertible
interface IParsable<bool>
interface ISpanParsable<bool>
[<System.Serializable>]
type bool = struct
interface IConvertible
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type bool = struct
interface IConvertible
type bool = struct
Public Structure Boolean
Implements IComparable, IComparable(Of Boolean), IConvertible, IEquatable(Of Boolean)
Public Structure Boolean
Implements IComparable, IComparable(Of Boolean), IConvertible, IEquatable(Of Boolean), IParsable(Of Boolean), ISpanParsable(Of Boolean)
Public Structure Boolean
Implements IComparable, IConvertible
Public Structure Boolean
Implements IComparable, IComparable(Of Boolean), IEquatable(Of Boolean)
Inheritance
Attributes
Implements
For more information about this API, see Supplemental API remarks for Boolean.
Fields
FalseString | Represents the Boolean value false as a string. This field is read-only. |
---|---|
TrueString | Represents the Boolean value true as a string. This field is read-only. |
Methods
CompareTo(Boolean) | Compares this instance to a specified Boolean object and returns an integer that indicates their relationship to one another. |
---|---|
CompareTo(Object) | Compares this instance to a specified object and returns an integer that indicates their relationship to one another. |
Equals(Boolean) | Returns a value indicating whether this instance is equal to a specified Boolean object. |
Equals(Object) | Returns a value indicating whether this instance is equal to a specified object. |
GetHashCode() | Returns the hash code for this instance. |
GetTypeCode() | Returns the type code for the Boolean value type. |
Parse(ReadOnlySpan) | Converts the specified span representation of a logical value to its Boolean equivalent. |
Parse(String) | Converts the specified string representation of a logical value to its Boolean equivalent. |
ToString() | Converts the value of this instance to its equivalent string representation (either "True" or "False"). |
ToString(IFormatProvider) | Converts the value of this instance to its equivalent string representation (either "True" or "False"). |
TryFormat(Span, Int32) | Tries to format the value of the current boolean instance into the provided span of characters. |
TryParse(ReadOnlySpan, Boolean) | Tries to convert the specified span representation of a logical value to its Boolean equivalent. |
TryParse(String, Boolean) | Tries to convert the specified string representation of a logical value to its Boolean equivalent. |
Explicit Interface Implementations
Applies to
Thread Safety
All members of this type are thread safe. Members that appear to modify instance state actually return a new instance initialized with the new value. As with any other type, reading and writing to a shared variable that contains an instance of this type must be protected by a lock to guarantee thread safety.