Swift create a multiline string literal


import UIKit

let singleLine = "Hello World"
print(singleLine)

let multiLine = """
Swift is a general-purpose, multi-paradigm, compiled programming language
developed by Apple Inc. for iOS, macOS, watchOS, tvOS, Linux and z/OS. Swift is
designed to work with Apple's Cocoa and Cocoa Touch frameworks and the large body
of existing Objective-C code written for Apple products.
"Some text inside double quotes as well"
"""
print(multiLine)

No comments:

Post a Comment

NO JUNK, Please try to keep this clean and related to the topic at hand.
Comments are for users to ask questions, collaborate or improve on existing.