Literals/String: Difference between revisions
→{{header|Wren}}: Updated to v0.4.0.
m (→{{header|LaTeX}}: Fixed extra quotation marks and shortened.) |
(→{{header|Wren}}: Updated to v0.4.0.) |
||
Line 2,896:
All strings are instances of the built-in String class and there is no separate Character class as such. Characters are simply strings consisting of a single byte or Unicode code point (1 to 4 bytes).
{| class="wikitable"
! Character !! Meaning
Line 2,911:
|-
| \b || Backspace
|-
| \e || ESC character
|-
| \f || Form feed
Line 2,929 ⟶ 2,931:
|}
From v0.4.0 Wren also supports ''raw'' string literals. These are any text surrounded by triple double quotes, """, and are interpreted verbatim i.e. any control codes and/or interpolations are not processed as such. They can include single or double double quotes without problem.
<lang ecmascript>var s = "abc123"
var t = "abc\t123\%"
var u = "\U0001F64A\U0001F680"
var v = "%("abc" * 3)"
var w = """a"bc""def\n%(v)"""
System.print([s, t, u, v])</lang>▼
▲System.print([s, t, u, v, w])</lang>
{{out}}
<pre>
[abc123, abc 123%, 🙊🚀, abcabcabc, a"bc""def\n%(v)]
</pre>
|