Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

struct System.​Byte

Assembly: System.Runtime

Represents an 8-bit unsigned integer.

Fields and Constants

public const byte
MaxValue
Represents the largest possible value of a <see cref="T:System.Byte" /> . This field is constant.
public const byte
MinValue
Represents the smallest possible value of a <see cref="T:System.Byte" /> . This field is constant.

Methods

public int
CompareTo​(byte value)
value An 8-bit unsigned integer to compare.
Returns A signed integer that indicates the relative order of this instance and <paramref name="value" /> . <list type="table"> <listheader> <term> Return Value</term> <description> Description</description> </listheader> <item> <term> Less than zero</term> <description> This instance is less than <paramref name="value" />.</description> </item> <item> <term> Zero</term> <description> This instance is equal to <paramref name="value" />.</description> </item> <item> <term> Greater than zero</term> <description> This instance is greater than <paramref name="value" />.</description> </item> </list>
Compares this instance to a specified 8-bit unsigned integer and returns an indication of their relative values.
public int
CompareTo​(object value)
value An object to compare, or <see langword="null" /> .
Returns A signed integer that indicates the relative order of this instance and <paramref name="value" /> . <list type="table"> <listheader> <term> Return Value</term> <description> Description</description> </listheader> <item> <term> Less than zero</term> <description> This instance is less than <paramref name="value" />.</description> </item> <item> <term> Zero</term> <description> This instance is equal to <paramref name="value" />.</description> </item> <item> <term> Greater than zero</term> <description> This instance is greater than <paramref name="value" />, or <paramref name="value" /> is <see langword="null" />.</description> </item> </list>
Compares this instance to a specified object and returns an indication of their relative values.
public bool
Equals​(byte obj)
obj An object to compare to this instance.
Returns <see langword="true" /> if <paramref name="obj" /> is equal to this instance; otherwise, <see langword="false" /> .
Returns a value indicating whether this instance and a specified <see cref="T:System.Byte" /> object represent the same value.
public bool
Equals​(object obj)
obj An object to compare with this instance, or <see langword="null" /> .
Returns <see langword="true" /> if <paramref name="obj" /> is an instance of <see cref="T:System.Byte" /> and equals the value of this instance; otherwise, <see langword="false" /> .
Returns a value indicating whether this instance is equal to a specified object.
public int
GetHashCode​()
Returns A hash code for the current <see cref="T:System.Byte" /> .
Returns the hash code for this instance.
public TypeCode
GetTypeCode​()
Returns The enumerated constant, <see cref="F:System.TypeCode.Byte" /> .
Returns the <see cref="T:System.TypeCode" /> for value type <see cref="T:System.Byte" /> .
public string
ToString​()
Returns The string representation of the value of this object, which consists of a sequence of digits that range from 0 to 9 with no leading zeroes.
Converts the value of the current <see cref="T:System.Byte" /> object to its equivalent string representation.
public string
ToString​(IFormatProvider provider)
provider An object that supplies culture-specific formatting information.
Returns The string representation of the value of this object in the format specified by the <paramref name="provider" /> parameter.
Converts the numeric value of the current <see cref="T:System.Byte" /> object to its equivalent string representation using the specified culture-specific formatting information.
public string
ToString​(string format)
format A numeric format string.
Returns The string representation of the current <see cref="T:System.Byte" /> object, formatted as specified by the <paramref name="format" /> parameter.
Converts the value of the current <see cref="T:System.Byte" /> object to its equivalent string representation using the specified format.
public string
ToString​(string format, IFormatProvider provider)
format A standard or custom numeric format string.
provider An object that supplies culture-specific formatting information.
Returns The string representation of the current <see cref="T:System.Byte" /> object, formatted as specified by the <paramref name="format" /> and <paramref name="provider" /> parameters.
Converts the value of the current <see cref="T:System.Byte" /> object to its equivalent string representation using the specified format and culture-specific formatting information.
public bool
TryFormat​(Span`1 utf8Destination, Int32& bytesWritten, ReadOnlySpan`1 format = null, IFormatProvider provider = null)
public bool
TryFormat​(Span`1 destination, Int32& charsWritten, ReadOnlySpan`1 format = null, IFormatProvider provider = null)
protected void
Finalize​()
Inherited from object
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
public Type
GetType​()
Inherited from object
Returns The exact runtime type of the current instance.
Gets the <see cref="T:System.Type" /> of the current instance.
protected object
MemberwiseClone​()
Inherited from object
Returns A shallow copy of the current <see cref="T:System.Object" /> .
Creates a shallow copy of the current <see cref="T:System.Object" /> .