How could I split a string over multiple lines such as below?
var text:String = \"This is some text
over multiple lines\"
Multi-line strings are possible as of Swift 4.0, but there are some rules:
""".""" should also start on its own line.Other than that, you're good to go! Here's an example:
let longString = """
When you write a string that spans multiple
lines make sure you start its content on a
line all of its own, and end it with three
quotes also on a line of their own.
Multi-line strings also let you write "quote marks"
freely inside your strings, which is great!
"""
See what's new in Swift 4 for more information.