Text expressions

A text expression resolves to a series of characters, and you specify such an expression in various situations; for example, on the right side of an assignment statement. The text expression may be any of these:

Although an item or return value can contain Unicode characters, a literal cannot.

Any character preceded with the escape character (\) is included in the text expression. In particular, you can use the escape character to include the following characters in a literal, item, or return value:

Examples are as follows:

  myString  = "He said, \"Escape while you can!\"";
  myString2 = "Is a backslash (\\) needed?";

An error occurs if a literal has no ending quote mark:

  myString3 = "Escape is impossible\";

Each value in the text expression must be valid for the context in which the expression is used. For example, an item of type UNICODE cannot be used in an expression assigned to an item of type CHAR. Additional details are in Assignments.

Related reference
Assignments
Datetime expressions
Expressions
Items
Logical expressions
Numeric expressions
Operators and precedence
Primitive types
Text formatting (system words)
Substrings