Simpler String slicing in Swift 4

Viewed 1951

Swift 4 changed how strings worked. However, seems to have got more complicated and less readable. Can anyone simplify this example (simply gets the third letter of a String as a String)? (Other than splitting out the lines.)

let myString="abc"
let thirdLetter = String(myString[myString.index(myString.startIndex, offsetBy: 2)])
2 Answers
Related