是否可以在引号中包含引号? [英] Is it possible to include a quotation mark as part of an nsstring?

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

问题描述

我有一个显示英寸的标签。我想用英文符号()或引号显示数字。我可以用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: "

这篇关于是否可以在引号中包含引号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆