2.6. Data Type string

Represents a character string of almost arbitrary length (limited only by memory restrictions). String constants consist of UNICODE characters encoded in UTF8. They are enclosed in double quotes.

The backslash in string can be used to mark special characters:

RepresentationMeaning
\nNewline (ASCII 10)
\tTabulator
\rCarriage Return (ASCII 13)
\bBackspace
\fForm Feed
\abc ASCII character represented by the octal value abc. Note that unlike in C, there must be exactly 3 octal digits!
\XThe character X itself.

A backslash followed by a newline makes both the backslash and the newline being ignored. Thus you can split a string constant over multiple lines in the YCP code.

Example 2.4. String constants

This string ends with a newline character.\n”
“This is also a newline: \012