本文介绍了是否可以将引号作为 nsstring 的一部分包含在内?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个显示英寸的标签.我想用英寸符号 (") 或引号来显示数字.我可以用 nsstring 来做到这一点吗?谢谢!

I have a label that displays inches. I would like to display the number with the inch symbol (") or quotation mark. Can I do this with an nsstring?Thanks!

推荐答案

当然,你只需要转义引号.

Sure, you just need to escape the quotation mark.

NSString *someString = @"This is a quotation mark: "";
NSLog(@"%@", someString );

输出:

This is a quotation mark: "

这篇关于是否可以将引号作为 nsstring 的一部分包含在内?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 12:53
查看更多