【发布时间】:2010-11-24 01:14:15
【问题描述】:
我希望双引号出现在以下字符串中,这样它看起来像:
"hi there == "
这是我正在使用的代码:
NSMutableString *s = [[NSMutableString alloc] init];
[s appendString:@""""];
[s appendString:@"hi there == ""\n\r"];
相反,我只得到:
hi there ==
有什么想法吗?
【问题讨论】:
-
需要注意的是[s appendString:@"hi there == ""\n\r"];无意中利用了 C/C++/ObjC 特性:将两个彼此相邻放置的字符串文字(中间有或没有空格)连接起来。
标签: objective-c cocoa