I have seen many methods for removing the last character from a string. Is there however a way to remove any old character based on its index?
Swift 3.2
let str = "hello" let position = 2 let subStr = str.prefix(upTo: str.index(str.startIndex, offsetBy: position)) + str.suffix(from: str.index(str.startIndex, offsetBy: (position + 1))) print(subStr)
"helo"