Is there a quick way to remove the last two characters in a String in Swift 3.0? I see there is a simple way to remove the last character as clearly noted here. Do you know how to remove the last two characters? Thanks!
var name: String = "Dolphin" let endIndex = name.index(name.endIndex, offsetBy: -2) var truncated = name.substring(to: endIndex) print(name) // "Dolphin" print(truncated) // "Dolph"