質問

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!

役に立ちましたか?

解決

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

@"A string with a quote \", a tab \t, a new line \n, and a backslash \\";
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top