String literals appear as a part of expressions.
String literals are also sometimes called character literals or text literals. When a string literal appears as part of an expression in this documentation, it is indicated by the word TEXT. The syntax for for both single-line and multi-line string literals is:
'character_string'
In all cases, character_string is a combination of alphabetic characters, numeric characters, punctuation marks, spaces, and tabs. In addition:
Both single-line and multi-line string literals must be enclosed in single (' ') quotation marks.
Double (" ") quotation marks can be used as part of a string.
Two adjacent single quotation marks with no character string between represent an empty string.
To include a single quotation mark (or an apostrophe) in a string delimited by single quotation marks, enter a backslash before the quotation mark ( \' ) for the inside quotation marks. For example:
'And that\'s the truth.'
To include a single quotation mark (or an apostrophe) in a string literal (delimited by single quotation marks), enter a backslash before the quotation mark or apostrophe you want to include in the string: ( \' ). For example:
'He said "No!"'
Some examples of valid string literals are:
'abc123' 'abc 123' 'It\'s a good idea.' '"What?" he asked.'
Internationalization impacts string literals. All the literals in the preceding list are 7-bit ASCII literals. But this is also a literal:
'αβγ123'