up previous next
4.3.4 Quotes Within Strings
***** NOT YET UPDATED TO CoCoA-5: follow with care *****

Strings are delimited using double quotes (or single quotes, obsolescent). One may directly use quotes inside a string if they are not of the same type as the delimiters (i.e. single quotes between double quotes). To get double quotes inside a string (which are of the same type as the delimiters), the quotes must be escaped by preceding them with a backslash. Note: from 4.7.5 escaping quotes by doubling them is obsolescent.

Example
  Print "This string \"contains\" double quotes.";
This string "contains" double quotes.
-------------------------------
  Print "This string \"contains\" quotes of 'various' styles.";
This string "contains" quotes of 'various' styles.
-------------------------------
Imagine the difficulties in writing this section of the online manual within a CoCoA package. ;>