EGL Reference Guide for iSeries

String expressions

A string 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 single operand that constitutes a string 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 string 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\";


Related reference
Items
Expressions
Logical expressions
Numeric expressions
Operators and precedence
Primitive types


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]