在使用字符串时不可避免的经常用到转义字符\,今天看了C++标准库,看到了string 的新特性,可以不再使用转义字符,如下:
string data = "what\' your name";
string data = R"(what' your name)";
在使用()时需注意:R"delim(what' your name)delim",delim是字符序列,不得超过16个字符。
在使用字符串时不可避免的经常用到转义字符\,今天看了C++标准库,看到了string 的新特性,可以不再使用转义字符,如下:
string data = "what\' your name";
string data = R"(what' your name)";
在使用()时需注意:R"delim(what' your name)delim",delim是字符序列,不得超过16个字符。