mirror of
https://github.com/moudey/Shell.git
synced 2026-11-16 09:04:25 +08:00
Update string.html to match v1.9 changes
This commit is contained in:
1 parent
dd74650cdd
commit
0b93fb86fc
1 file changed
+7
-17
@@ -1,30 +1,21 @@
|
||||
<h4>String literal</h4>
|
||||
<h4>String literal</h4>
|
||||
<br>
|
||||
<p>string is zero or more characters written inside single or double quotes.</p>
|
||||
<p>You can use quotes inside a string, as long as they don't match the quotes surrounding the string:</p>
|
||||
<pre><code class="lang-shell">var
|
||||
{
|
||||
var1 = "It's alright"
|
||||
var2 = "He is called 'Johnny'"
|
||||
var3 = 'He is called "Johnny"'
|
||||
}</code></pre>
|
||||
<pre><code class="lang-shell">$var1 = "It's alright"
|
||||
$var2 = "He is called 'Johnny'"
|
||||
$var3 = 'He is called "Johnny"'</code></pre>
|
||||
<br>
|
||||
<h5>Single quotes</h5>
|
||||
<br>
|
||||
<p>single quotes allow you to use the syntax of expressions within them.<br/>The <code>@</code> sign must be placed before the expressions.</p>
|
||||
<pre><code class="lang-shell">dynamic
|
||||
{
|
||||
item(title = 'windows dir path: @sys.dir')
|
||||
}</code></pre>
|
||||
<pre><code class="lang-shell">item(title = 'windows dir path: @sys.dir')</code></pre>
|
||||
<br>
|
||||
<h5>Double quotes</h5>
|
||||
<br>
|
||||
<p>double quotes allow you to use the Escape Character inside them only.<br/>The backslash (<code>\</code>) escape character turns special characters into characters.<br/>The sequence <code>\" </code> inserts a double quote in a string:</p>
|
||||
<pre><code class="lang-shell">var
|
||||
{
|
||||
var1 = "hello\"world"
|
||||
// result: hello"world
|
||||
}</code></pre>
|
||||
<pre><code class="lang-shell">$var1 = "hello\"world"
|
||||
// result: hello"world</code></pre>
|
||||
<p>The complete set of escape sequences is as follows:</p>
|
||||
<table class="table">
|
||||
<tbody>
|
||||
@@ -44,4 +35,3 @@
|
||||
<tr><td>\Uxxxxxxxx</td><td>Unicode escape sequence (UTF-32) \U00HHHHHH (range: 000000 - 10FFFF)</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Reference in new issue
Block a user