I have the following code:
let hello = "Hola"
let indexI = hello.startIndex
let indexF = hello.endIndex
hello[indexI] // "H"
hello[hello.startIndex] // H
hello[hello.index(after: indexI)] // o
hello[indexF] // Fatal error: Can't form a Character from an empty String
But I have an error in hello[indexF]Why?
endindexit says A string’s “past the end” position—that is, the position one greater than the last valid subscript argument.