I really enjoy programming in Swift, but I’ve always been bothered a bit by what I perceived as a couple of shortcomings related to the String class.
There is no support for subscripting a String.
Try the following in a Playground and you’ll get an error:
let str = "Hello" str // 'subscript' is unavailable: cannot subscript String with an Int str[1..<3] // 'subscript' is unavailable: cannot subscript String with an integer range
You can find a mention of this restriction in some source code comments.