Product Site

1.10.4.1. Literal Strings

A literal string is a sequence including any characters except line-end and end-of-file characters, and delimited by a single quotation mark (') or a double quotation mark ("). You use two consecutive double quotation marks ("") to represent one double quotation mark (") within a literal string delimited by double quotation marks. Similarly, you use two consecutive single quotation marks ('') to represent one single quotation mark (') within a string delimited by single quotation marks. A literal string is a constant and its contents are never modified when it is processed. Literal strings must be complete on a single line. This means that unmatched quotation marks can be detected on the line where they occur.

A literal string with no characters (that is, a string of length 0) is called a null string.

These are valid strings:
Example 1.7. Valid strings
"Fred"
"Don't Panic!"
'You shouldn''t'        /* Same as "You shouldn't" */
""                      /* The null string         */

A literal string has no upper bound on the number of characters, limited only by available memory.

Note that a string immediately followed by a left parenthesis is considered to be the name of a function. If immediately followed by the symbol X or x, it is considered to be a hexadecimal string. If followed immediately by the symbol B or b, it is considered to be a binary string.