Strings
Overview
VEX includes a string datatype. This is useful in several places:
VEX包含一个字符串数据类型。这在以下几个方面很有用:
-
Manipulating text 操纵文本
-
Referencing filenames and op node names 引用文件名和op节点名
-
Manipulating binary data 操作二进制数据
String Literals 字符串
String literals can be enclosed in either single quotes (') or double quotes ("). Strings may also be specified using the Python or C++ raw-string format.
字符串文本可以用单引号(')或双引号(")括起来。字符串也可以使用Python或c++ raw-string格式指定。
string s = 'foo'; string t = "bar"; string py = r"Hello world\n"; // Python style, equivalent to "Hello world\\n" string cpp = R"(Hello world\n)"; // C++ style, equivalent to "Hello world\\n"
Escaped strings (non-raw strings) automatically convert known esc