I noticed that the raw string literal uses '\n' for line endings. I would like to change it to "\r\n", How do i do that? Im using Visual Studio 2022.
std::string req = R"(line 1
line 2
line 3
)";
for (size_t i = 0; i < req.size(); i++)
{
if (req[i] == '\n') {
std::cout << "\\n";
}
else if (req[i] == '\r') {
std::cout << "\\r";
}
else {
std::cout << req[i];
}
}
The output is line 1\nline 2\nline 3\n Is it possible to make it line 1\r\nline 2\r\nline 3\r\n