如何在字符串中插入双引号?

Bao*_*iep 3 text swift

我想在我的变量字符串中插入 ":

let myText : String = "\(")"
print("the result "+myText)
Run Code Online (Sandbox Code Playgroud)

我想要的结果

结果 ”

aya*_*aio 8

在 Xcode 6.x 和 Xcode 7.0 中,您必须"使用 a\对字符进行转义才能将其插入字符串中:

let myText = "\""
print("the result " + myText)
Run Code Online (Sandbox Code Playgroud)

结果:

结果 ”