Vai al contenuto

String Character Literals

A string character literal is a sequence of zero or more characters prefixed and terminated by the single quote character (‘).The three-character combination of the dollar sign ($) followed by two hexadecimal digits shall be interpreted as the hexadecimal representation of the eight-bit character code.
ExampleExplanation
Empty string (length zero).
‘A’String of length one containing the single character A.
‘ ‘String of length one containing the space character.
‘$”String of length one containing the single quote character.
‘”’String of length one containing the double quote character.
‘$R$L’String of length two containing CR and LF characters.
‘$0A’String of length one containing the LF character.
Two-character combinations beginning with the dollar sign shall be interpreted as shown in the following table when they occur in character strings.
CombinationInterpretation when printed
$$Dollar sign
$’Single quote
$L o $1Line feed
$N o $nNewline
$P o $pForm feed (page)
$R o $rCarriage return
$T o $tTab
Wide String Character LiteralsA wide string character literal is a sequence of zero or more characters prefixed and ter- minated by the double quote character (“).The three-character combination of the dollar sign ($) followed by two hexadecimal digits shall be interpreted as the hexadecimal representation of the eight-bit character code.
ExampleExplanation
Empty string (length zero).
‘A’Wide string of length one containing the single character A.
‘ ‘Wide string of length one containing the space character.
‘$”Wide string of length one containing the single quote character.
‘”’Wide string of length one containing the double quote character.
‘$R$L’Wide string of length two containing CR and LF characters.
‘$0A’Wide string of length one containing the LF character.
Two-character combinations beginning with the dollar sign shall be interpreted as shown in the following table when they occur in wide character strings.
CombinationInterpretation when printed
$$Dollar sign
$’Single quote
$L o $1Line feed
$N o $nNewline
$P o $pForm feed (page)
$R o $rCarriage return
$T o $tTab