我想在我的变量字符串中插入 ":
let myText : String = "\(")"
print("the result "+myText)
Run Code Online (Sandbox Code Playgroud)
我想要的结果
结果 ”
在 Xcode 6.x 和 Xcode 7.0 中,您必须"使用 a\对字符进行转义才能将其插入字符串中:
let myText = "\""
print("the result " + myText)
Run Code Online (Sandbox Code Playgroud)
结果:
结果 ”
| 归档时间: |
|
| 查看次数: |
4915 次 |
| 最近记录: |