I am beginner of Swift 3 and came across one example to retrieve a character using string indices. I do not have swift 3 installed but I doubt one thing that is different from explanation. I do not know, it is bug, writing mistake or what. Below is a example from page 166 of "The Swift Programming Language(Swift 3 beta)".
let greeting = "Guten Tag!"
greeting[greeting.startIndex] //Prints G according to text. Fine according to definition.
greeting[greeting.index(before:greeting.endIndex)] //Prints ! according to text. Now if you look at greeting String, the character before endIndex is g. It must print g according to definition.
greeting[greeting.index(after:greeting.startIndex)] //Prints u according to text and is right according to definition also.
Somebody can explain this behaviour?