Literals/String: Difference between revisions
m
\u, \U are now properly explained in the official documentation.
(Added TOML) |
m (\u, \U are now properly explained in the official documentation.) |
||
Line 1,833:
\t #09 tab
\\ #5C backslash
\" #22 double quote (the \ is optional in ', mandatory in ")
\' #27 single quote (the \ is optional in ", mandatory in ')
\0 #00 null
\#HH #HH any hexadecimal byte
\xHH #HH any hexadecimal byte
\uH4 - any 16-bit unicode point, eg "\u1234", max #FFFF
\UH8 - any 32-bit unicode point, eg "\U00105678", max #10FFFF
</pre>
There are no other automatic substitutions or interpolation, other than through explict function calls such as [s]printf().
Strings can also be entered by using triple quotes or backticks intead of double quotes to include linebreaks and avoid any backslash interpretation.
Line 1,851 ⟶ 1,853:
string\thing"""
ts =
string\thing
ts = "this\nstring\\thing"</lang>
Line 1,863 ⟶ 1,865:
Hex string literals are also supported (mainly for compatibility with OpenEuphoria, x/u/U for 1/2/4 byte codes), eg:
<lang Phix>?x"68 65 6c 6c 6f"; -- displays "hello"</lang>
=={{header|PHP}}==
|