![]() |
VOOZH | about |
In C#, the UInt16 struct, defined under the System namespace, represents a 16-bit unsigned integer, commonly referred to as the ushort data type. It does not support negative values and provides a range from 0 to 65,535. The UInt16 struct inherits the ValueType class, which further inherits the Object class.
Example:
Not equal
Method | Description |
|---|---|
Compares the current instance to a specified object or UInt16 and returns an indication of their relative values. | |
Returns a value which shows whether the current instance is equal to a specified object or UInt16. | |
Returns the hash code for this instance. | |
Returns the TypeCode for value type UInt16. | |
Parse() | Converts the string representation of a number to its 16-bit unsigned integer equivalent |
| Converts the numeric value of this instance to its equivalent string representation. | |
TryParse() | Converts a number in string form to a 16-bit unsigned integer, indicating success or failure. |
Example: Using GetHashCode() Method
Hash code of val: 545