Swift – Double Quotes inside String
To include quotes inside a string in Swift, escape the quote symbol with backslash character, i.e., place a backslash character before the double quote inside the string.
In the following program, we initialized a variable with String value containing double quote. We have escaped the double quote with a backslash character.
import Foundation var name = "Hello \"World" print(name)
In this Swift Tutorial, we learned how to include double quotes inside a String value in Swift, with the help of example programs.