File: string-literals.txt

package info (click to toggle)
highlight.js 10.7.3%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,332 kB
  • sloc: javascript: 41,059; makefile: 157; python: 29; sh: 20
file content (69 lines) | stat: -rw-r--r-- 1,151 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// Unicode literals
auto str   = "Hello regular string";
auto utf8  = u8"Hello utf-8 string";
auto utf16 = u"Hello utf-16 string";
auto utf32 = U"Hello utf-32 string";

// Wide-character strings
auto wide_char = L"Hello wchar_t string";
auto lr = LR"(Hello
world)";

// character literals
auto wide_char = L'H';
auto cr   = '\n';
auto chr   = 'H';
auto utf8  = u8'H';
auto utf16 = u'H';
auto utf32 = U'H';
auto unicode = L'\u202e'
auto hex = '\xFF'
auto octal = '\123'

// Raw string literals (multiline)
auto char_multi  = R"(Hello
"normal"
multiline
string.)";
auto utf8_multi  = u8R"(Hello
"utf-8"
multiline
string)";
auto utf16_multi = uR"(Hello
"utf-16"
multiline
string)";
auto utf32_multi = UR"(Hello
"utf-32"
multiline
string)";

// Raw string literals with delimiter (multiline)
auto char_multi  = R"blah1(Hello
"normal"
multiline
)"
)blah"
string.)blah1";
auto utf8_multi  = u8R"blah2(Hello
"utf-8"
multiline
)"
)blah"
string)blah2";
auto utf16_multi = uR"blah3(Hello
"utf-16"
multiline
)"
)blah"
string)blah3";
auto utf32_multi = UR"blah4(Hello
"utf-32"
multiline
)"
)blah"
string)blah4";

// Meta strings
#include <stdio>
#include "lib.h"