File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ id : " string-literal"
3
+ keywords : ["string"]
4
+ name : " \"\" "
5
+ summary : " This is the `string` literal syntax."
6
+ category : " languageconstructs"
7
+ ---
8
+
9
+ A ` string ` literal is composed of two ** double** quotes. Single quotes are reserved for the ` char ` type.
10
+
11
+ ### Example
12
+
13
+ <CodeTab labels = { [" ReScript" , " JS Output" ]} >
14
+
15
+ ``` res
16
+ let myString = "Single line " ++ "string!"
17
+ let myMultiLineString = "Multi
18
+ line
19
+ string!"
20
+ ```
21
+
22
+ ``` js
23
+ var myString = " Single line string!" ;
24
+
25
+ var myMultiLineString = " Multi\n line\n string!" ;
26
+ ```
27
+
28
+ </CodeTab >
29
+
30
+ ### References
31
+
32
+ * [ Strings] ( /docs/manual/latest/primitive-types#string )
33
+ * [ Characters] ( /docs/manual/latest/primitive-types#char )
You can’t perform that action at this time.
0 commit comments