iOSbuddy iOSbuddy - 4 months ago 6
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"


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.