Data types: char

Represents a single 16-bit UNICODE character (Supports code points from UNICODE plane 0).

Type syntax


Literal syntax





The char literal consists of a single UNICODE character enclosed between a pair of '...' (single quote) signs. Special characters including the single quote sign ' itself and characters that can't be entered directly from the keyboard are expressed by escape sequences prefixed with the \ (backslash) sign. The literal can be used within expressions wherever a char operand is expected. The type name char, in turn, is designated to be used in declarations of data members. For example:

var char currency = '$'; var char gammaSign = '\x0393';

The following table shows the entire set of supported escape sequences. Each sequence starts with a \ (backslash) sign. The Chora compiler will automatically replace each found escape sequence with the corresponding character code. Please note the usage of escape sequences to represent the ' (single quote) and the \ (backslash) signs:

Escape sequence

Short description


Character with code 0x005C (the \ backslash sign)


Character with code 0x0027 (the ' single quote sign)


Character with code 0x0022 (the " double quote sign)


Character in hexadecimal notation with 4 hex digits


Character with code 0x000A (corresponds to ASCII code Newline)


Character with code 0x0007 (corresponds to ASCII code Alert)


Character with code 0x0008 (corresponds to ASCII code Backspace)


Character with code 0x000C (corresponds to ASCII code Form-feed)


Character with code 0x000D (corresponds to ASCII code Carriage return)


Character with code 0x0009 (corresponds to ASCII code Tabulator)


Character with code 0x000B (corresponds to ASCII code vertical tab)


Character with the code 0

Instant properties

The following instant properties provide a convenient interface to access and evaluate char operands:

Instant property name

Short description


Represents the lower case version of a char operand.


Represents the upper case version of a char operand.

Arithmetic and string concatenation operations

You can combine a char operand with other operands to expressions. The following table provides an overview of the possible operations:


Short description


String concatenation or char and integer addition.


Difference between two char codes or char and integer subtraction.

Comparison operations

You can compare two char operands in order to test whether these are equal or not. The following table provides an overview of the possible operations:


Short description






Less than


Greater than


Less than or equal


Greater than or equal

Type conversions

Chora reacts sensitive when mixing operands of different data types within an operation. To avoid compiler warnings or even errors you can convert between char and integer operands explicitly.