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
If `value` is a number, returns the corresponding
ASCII character.
If `count` is provided, the character is repeated up to 1000 times.
If `value` is a string, encodes the string as a numerical representation.
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