To avoid escaping characters, define the string literals with the following:
- R"( literal )" as the default form:
auto filename {R"(C:UsersMariusDocuments)"s};
auto pattern {R"((w+)=(d+)$)"s};
auto sqlselect {
R"(SELECT *
FROM Books
WHERE Publisher='Paktpub'
ORDER BY PubDate DESC)"s};
- R"delimiter( literal )delimiter" where delimiter is any character sequence not present in the actual string when the sequence )" should actually be part of the string. Here is an example with !! as delimited:
auto text{ R"!!(This text contains both "( and )".)!!"s };
std::cout << text << std::endl;