Is there a quick way to remove the last two characters in a String in Swift? I see there is a simple way to remove the last character as clearly noted here. Do you know ho
swift 4:
let str = "Hello, playground" let newSTR1 = str.dropLast(3) print(newSTR1) output: "Hello, playgro" //---------------// let str = "Hello, playground" let newSTR2 = str.dropFirst(2) print(newSTR2) output: "llo, playground"