Get substring from range


I have a string and want to retrieve a substring found within a specific range.


// String literal
let s = "Hello World"

// Get the substring from position 6
// to the end: 'World'

let sub = s[s.startIndex.advancedBy(6)..<s.endIndex]

Heard the news?

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