Chr() - Syntax & Usage | AutoHotkey

AutoHotkey

Chr()

Returns the string (usually a single character) corresponding to the character code indicated by the specified number.

String := Chr(Number)

Parameters

Number

If Unicode is supported, Number is a Unicode character code between 0 and 0x10FFFF (or 0xFFFF prior to [v1.1.21]); otherwise it is an ANSI character code between 0 and 255.

Return Value

This function returns a string corresponding to Number. If Number is not in the valid range of character codes, an empty string is returned.

Remarks

This function supersedes Transform, OutputVar, Chr.

The meaning of character codes greater than 127 depends on the string encoding in use, which in turn depends on whether a Unicode or ANSI executable is in use.

Common character codes include 9 (tab), 10 (linefeed), 13 (carriage return), 32 (space), 48-57 (the digits 0-9), 65-90 (uppercase A-Z), and 97-122 (lowercase a-z).

Related

Transform, Ord(), Asc()

Examples

MsgBox, % Chr(116) ; Shows "t".