Tabular IQ
Back to Function Index

CHR()

Overview

CHR() converts numeric ASCII character codes to their corresponding characters. This function is particularly useful when you need to include special characters, control characters, or non-standard characters in strings. It's commonly used for formatting text, creating line breaks, tabs, or other special characters that can't be directly typed.

Function Format

CHR(number)

Return Value

CHR() returns a single character string

Examples


CHR(50)  = "2"     (ASCII code for digit 2)
CHR(80)  = "P"     (ASCII code for uppercase P)
CHR(112) = "p"     (ASCII code for lowercase p)
CHR(123) = "{"     (ASCII code for opening brace)
CHR(9)   = "  "    (ASCII code for tab)
CHR(13)  = ""      (ASCII code for carriage return)
CHR(10)  = ""      (ASCII code for line feed)
CHR(32)  = " "     (ASCII code for space)

Notes

  • The input number must be a valid ASCII code (typically between 0 and 127).
  • Common ASCII codes include:
    • 9: Tab
    • 10: Line Feed
    • 13: Carriage Return
    • 32: Space
    • 48-57: Digits 0-9
    • 65-90: Uppercase letters A-Z
    • 97-122: Lowercase letters a-z
  • This function is often used in combination with other string functions to create formatted output.
  • For extended ASCII characters (codes 128-255), the result may vary depending on the character encoding.
  • This function is particularly useful for creating formatted text or including special characters in strings.