iOSbuddy iOSbuddy - 1 year ago 112
Swift Question

How to print double quotes inside ""?

Can someone please tell me how can I print something in following way "with" double quotes.

"Double Quotes"

Answer Source

With a backslash before the double quote you want to insert in the String:

let sentence = "They said \"It's okay\", didn't they?"

Now sentence is:

They said "It's okay", didn't they?

It's called "escaping" a character: you're using its literal value, it will not be interpreted.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download