blob: 65a78e9697db6225a79f83ae9b5c1574f6f9bcb2 [file] [log] [blame] [view]
Marcel van Lohuizen75cb0032019-01-11 12:10:48 +01001[TOC](Readme.md) [Prev](numberlit.md) [Next](bytes.md)
2
3# String Literals
4
5CUE stings allow a richer set of escape sequences.
6
7CUE also supports multi-line strings, enclosed by a pair of triple quotes `"""`.
8The opening quote must be followed by a newline.
9The closing quote must also be on a newline.
10The whitespace directly preceding the closing quote must match the preceding
11whitespace on all other lines and is removed from these lines.
12
13Strings may also contain [interpolations](interpolation.md).
14
15<!-- CUE editor -->
16```
17// 21-bit unicode characters
18a: "\U0001F60E" // 😎
19
20// multiline strings
21b: """
22 Hello
23 World!
24 """
25```
26
27<!-- JSON result -->
28```json
29{
30 a: "😎"
31 b: "Hello\nWorld!"
32}
33```