Question

I want to create a NSString that contains some HTML-Code. But as the HTML code contains a " the string ends too early.

This is the HTML code I want to add.

<FONT FACE="arial">arial font</FONT>

This is how I do it:

NSString *myHTMLcode = @"<FONT FACE="arial">arial font</FONT>"

As you can see, it stops too early (before the arial) What do I have to do in order to get a NSString that contains a "?

Thank you very much!

Was it helpful?

Solution

Use the standard (Objective-)C(++) escape character:

@"A string with a quote \", a tab \t, a new line \n, and a backslash \\";
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top