Wiki: Swift

Substrings

Prefix && Suffix (Thank primo)

let str = "Hello! World"
str.prefix(6) // "Hello!"
str.suffix(5) // "World"