Char: MaxValue (get) |
Represents the largest possible value of a Char.
Public Property Get MaxValue ( ) As Integer
A character is represented as a Unicode code point as a UTF-16 code unit from U+0000 to U+FFFF. Because Visual Basic does not contain an unsigned 16-bit integer type, VBCorLib utilizes the Integer type. The two types have the same binary representation, but have different numeric ranges. This leads to some difficulties when needing to compare characters for sort order.
The maximum character value would normally be U+FFFF(65535), however, when using the Integer type, the maximum character value becomes U+FFFF(-1). Even though they are the same with their binary representation, they cannot be directly compared for sort order.
If characters with the high bit set need to be compared then use the Char.Equals and Char.Compare methods to ensure correct results.
Read Only.