Char

Char


Provides methods for inspecting and manipulating Unicode characters.


Public:

Properties:

NameDescription
 MaxValue (get) Represents the largest possible value of a Char.  
 MinValue (get) Represents the smallest possible value of a Char.  

Methods:

NameDescription
 Compare Compares two character code units.  
 ConvertFromInt32 Converts a 32-bit signed integer value to a 16-bit signed integer as a character.  
 ConvertFromUtf32 Converts the specified Unicode code point into a UTF-16 encoded string.  
 ConvertToInt32 Converts the character value to a 32-bit signed integer.  
 ConvertToUtf32 Converts the value of a UTF-16 encoded surrogate pair into a Unicode code point.  
 ConvertToUtf32Str Converts the value of a UTF-16 encoded character or surrogate pair at a specified position in a string into a Unicode code point.  
 Equals Evaluates two character code units for equality.  
 IsHighSurrogate Indicates whether the specified character has a high surrogate code unit.  
 IsHighSurrogateStr Indicates where the character in the string at the specified index is a high surrogate code unit.  
 IsLowSurrogate Indicates whether the specified character has a low surrogate code unit.  
 IsLowSurrogateStr Indicates where the character in the string at the specified index is a low surrogate code unit.  
 IsSurrogate Indicates whether the specified character has a surrogate code unit.  
 IsSurrogateStr Indicates whether the character at the specified position in a specified string has a surrogate code unit.  
 IsWhiteSpace Indicates if a character is white space.  
 IsWhiteSpaceStr Indicates if the specified character in a string is white space.  

Remarks

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.

If characters with the high bit set need to be compared then use the Char.Equals and Char.Compare methods to ensure correct results.

See Also

Project CorLib Overview

Class Char Overview

Equals

Compare

ConvertToInt32

ConvertFromInt32