Use string interpolation

 Problem

I have a string and I want to embed variable values within this string.



 Recipe


// String literal
var username = "John"

// Let's print this string
// along with a 'hello' message

print("Hello \(username)");
				

Heard the news?

The Swift Cookbook for Swift 3 is at last here! For iBooks, Kindle and Paperback.
Hurry up - and Check it out! ;-)

 

 Playground