What does #13#10 stand for, in Delphi code?

Control strings in Delphi extend your text-based toolkit

Delphi Tool Palette
Delphi Tool Palette.

Cryptic strings like 13#10 appear regularly within Delphi source code. These strings aren't random gibberish, however — they serve an essential purpose for text layout.

A control string is a sequence of one or more control characters, each of which consists of the # symbol followed by an unsigned integer constant from 0 to 255 (decimal or hexadecimal) and denotes the corresponding ASCII character.

For example, to assign a two-line string to a Caption property of a TLabel control, use the following pseudocode:

Label1.Caption := 'First line' + #13#10 + 'Second line';

The "#13#10" part represents a carriage return + line feed combination. The "#13" is the ASCII equivalent of the CR (carriage return) value; #10 represents LF (line feed).

Two more interesting control characters include:

  • #0 — NULL character
  • #9 — (horizontal) TAB