Contact: aviboots(AT)netvision.net.il
40,866 questions
53,271 answers
573 users
let s = "swift" let lastCharacter = s.last! print(lastCharacter) /* run: t */
let s = "swift" let lastCharacter = s[s.index(before: s.endIndex)] print(lastCharacter) /* run: t */
let s = "swift" let lastCharacter = s.suffix(1) print(lastCharacter) /* run: t */