chr()

Converts a number to a character or a string.

If a second parameter is provided, repeats the character up to 1000 times.

Syntax

chr(value)
chr(value, count)

Parameters

Parameter Type Description
value Number/String A number to convert to a character or a string to process.
count Number (optional) The number of times to repeat the character. optional

Return Value

Examples

Convert number to character

chr(65);      // returns "A"
chr(97, 3);   // returns "aaa"

Encode string into a numeric representation

chr("A");    // returns 65
chr("AB");    // returns 16706

See also

str
strlen
padleft
padright
hex
bin
chr
match