From 0b93fb86fcefe315ca47434d87490b94bcce07b8 Mon Sep 17 00:00:00 2001 From: Yuran Date: Mon, 3 Jun 2024 11:58:03 +0700 Subject: [PATCH] Update string.html to match v1.9 changes --- docs/expressions/string.html | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/docs/expressions/string.html b/docs/expressions/string.html index 9a39c7e..349b90e 100644 --- a/docs/expressions/string.html +++ b/docs/expressions/string.html @@ -1,30 +1,21 @@ -

String literal

+

String literal


string is zero or more characters written inside single or double quotes.

You can use quotes inside a string, as long as they don't match the quotes surrounding the string:

-
var
-{
-    var1 = "It's alright"
-    var2 = "He is called 'Johnny'"
-    var3 = 'He is called "Johnny"'
-}
+
$var1 = "It's alright"
+$var2 = "He is called 'Johnny'"
+$var3 = 'He is called "Johnny"'

Single quotes

single quotes allow you to use the syntax of expressions within them.
The @ sign must be placed before the expressions.

-
dynamic
-{
-    item(title = 'windows dir path: @sys.dir')
-}
+
item(title = 'windows dir path: @sys.dir')

Double quotes

double quotes allow you to use the Escape Character inside them only.
The backslash (\) escape character turns special characters into characters.
The sequence \" inserts a double quote in a string:

-
var
-{
-    var1 = "hello\"world"
-    // result: hello"world
-}
+
$var1 = "hello\"world"
+// result: hello"world

The complete set of escape sequences is as follows:

@@ -44,4 +35,3 @@
\UxxxxxxxxUnicode escape sequence (UTF-32) \U00HHHHHH (range: 000000 - 10FFFF)
-