How to get a character from string using its index in Swift

1 Answer

0 votes
let s = "Swift Programming"

let char = s[s.index(s.startIndex, offsetBy: 1)]

print(char)




/*
run:

w

*/

 



answered Nov 10, 2020 by avibootz
...