Convert integer to string

 Problem

I have an integer and want to convert it to its string equivalent.



 Recipe


// Integer value
let n = 1986

// Get String value from integer
var s = String(n)
print(s)


				

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