Char Data Type

Holds unsigned 32-bit (4-byte) Unicode character code points in the range 0–4,294,967,295.

Instructions

Char is short for "character".

Default value
When you declare a variable of type Char and leave it uninitialized, its value defaults to the character with a code point of zero (0).
Negation
Char is an unsigned type and thus cannot represent a negative value.
Coercion
Char widens to String without any risk of overflow.
Type characters
Char has no type character.

Unicode characters

TODO

Char literal

You can specify a code point for most Unicode characters directly in your code using a Char literal. This is done by placing backticks (`) around the character. You can specify a backtick character simply by using three consecutive backticks, as shown in the following examples.

Dim letter As Char = `A`
Dim backtick As Char = ```

Shared methods and properties

Char.Bits As Int
Returns the number of available bits. This is always 32.
Char.Lower(c As Char, Optional #fmt As Format) As Char
Returns a lower-case letter if given an upper-case letter, or the given character if it is not a letter.
Char.Upper(c As Char, Optional #fmt As Format) As Char
Returns an upper-case letter if given a lower-case letter, or the given character if it is not a letter.

The methods that follow have two overloads each: (1) a necessary character (c As Char), or (2) a necessary string (s As String) and a necessary offset (o As Int). The offset starts at zero.

Char.IsControl(c As Char) As Boolean
Char.IsControl(s As String, o As Int) As Boolean
Returns true if given a control character, and false if given a different character.
Char.IsDigit(c As Char) As Boolean
Char.IsDigit(s As String, o As Int) As Boolean
Returns true if given a number between 0 and 9, and false if given a different character.
Char.IsLetter(c As Char) As Boolean
Char.IsLetter(s As String, o As Int) As Boolean
Returns true if given a letter, and false if given a different character.
Char.IsLower(c As Char) As Boolean
Char.IsLower(s As String, o As Int) As Boolean
Returns true if given a lower-case letter, and false if given a different character.
Char.IsNumber(c As Char) As Boolean
Char.IsNumber(s As String, o As Int) As Boolean
Returns true if given a number or related character, and false if given a different character.
Char.IsPunctuation(c As Char) As Boolean
Char.IsPunctuation(s As String, o As Int) As Boolean
Returns true if given a punctuation character, and false if given a different character.
Char.IsSeparator(c As Char) As Boolean
Char.IsSeparator(s As String, o As Int) As Boolean
Returns true if given a separator character, and false if given a different character.
Char.IsSymbol(c As Char) As Boolean
Char.IsSymbol(s As String, o As Int) As Boolean
Returns true if given a symbol character, and false if given a different character.
Char.IsUpper(c As Char) As Boolean
Char.IsUpper(s As String, o As Int) As Boolean
Returns true if given an upper-case letter, and false if given a different character.
Char.IsWhitespace(c As Char) As Boolean
Char.IsWhitespace(s As String, o As Int) As Boolean
Returns true if given a whitespace character, and false if given a different character.
Char.UnicodeBlock(c As Char) As UnicodeBlocks
Char.UnicodeBlock(s As String, o As Int) As UnicodeBlocks
Returns an enumeration value of type UnicodeBlocks that agrees with the Unicode block of the given character.

See also