Code Snippet: Read File

From Coder Merlin
Within these castle walls be forged Mavens of Computer Science ...
— Merlin, The Coder

Read the contents of a file into a string[edit]

import Foundation

let contents = try! String(contentsOfFile: "hello.txt")