Is there a string literal form in Objective-c that does not require escaping special characters? In other words, I'm looking for an equivalent to the Python triple quote.
I'm trying to put some HTML into an NSString
, and would like to avoid having to escape the quotes from all the HTML attributes.
In C++11 you can do this. See my answer to a similar question.
For this you require in your case Objective-C++11. It should work though in gcc.
const char * html = R"HTML(
<HTML>
<HEAD>
<TITLE> [Python-Dev] Triple-quoted strings and indentation
</TITLE>
</HEAD>
<BODY BGCOLOR="#ffffff">
blah blah blah
</BODY>
</HTML>
)HTML";
int
main()
{
}
g++ -std=c++0x -o raw_string raw_string.mm at least compiles.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With