如何在string中双引号?
我想双引号出现在下面的string,所以它看起来像:
"hi there == " 以下是我正在使用的代码:
 NSMutableString *s = [[NSMutableString alloc] init]; [s appendString:@""""]; [s appendString:@"hi there == ""\n\r"]; 
相反,我只得到:
 hi there == 
有任何想法吗?
 [s appendString:@"hi there == \"\n\r"]; 
  \"什么是需要的" – 这是标准的C格式。 
虽然晚了,但我们可以试试这个:
 [NSString stringWithFormat:@"\"Hi There=\" Other text"]; 
您必须在引号(“)之前附加一个斜杠(\)才能获得预期的输出。
 [s appendString:@"\"hi there == \"\n\r"]; 
输出将是“hi there ==”