문제

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