Go to the first, previous, next, last section, table of contents.

2.6 String Literals

  1. A string_literal is formed by a sequence of graphic characters (possibly none) enclosed between two quotation marks used as string brackets. They are used to represent operator_symbols See section 6.1 Subprogram Declarations, values of a string type See section 4.2 Literals, and array subaggregates See section 4.3.3 Array Aggregates.


  2. string_literal ::= "{string_element}"
  3. string_element ::= "" | non_quotation_mark_graphic_character
    1. A string_element is either a pair of quotation marks (""), or a single graphic_character other than a quotation mark.

Static Semantics

  1. The sequence of characters of a string_literal is formed from the sequence of string_elements between the bracketing quotation marks, in the given order, with a string_element that is "" becoming a single quotation mark in the sequence of characters, and any other string_element being reproduced in the sequence.
  2. A null string literal is a string_literal with no string_elements between the quotation marks.


  3. (5) An end of line cannot appear in a string_literal.


  4. Examples of string literals:
    "Message of the day:"
    ""                           --  a null string literal
    " "   "A"   """"             --  three string literals of length 1
    "Characters such as $, %, and } are allowed in string literals"

Go to the first, previous, next, last section, table of contents.