I want to log an NSString but when I log it, it doesn't show the new line character " n". How can I make it so it does? Thanks.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You can process the string first and replace all occurrences of \n
with \\n
NSString *newString = [originalString stringByReplacingOccurrencesOfString:@"\n" withString:@"\\n"];