Get substring from range

 Problem

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



 Recipe


// 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]
print(s)
				


 Playground