How can I remove last character from String variable using Swift? Can\'t find it in documentation.
Here is full example:
var expression = \"45+22\" e
import UIKit var str1 = "Hello, playground" str1.removeLast() print(str1) var str2 = "Hello, playground" str2.removeLast(3) print(str2) var str3 = "Hello, playground" str3.removeFirst(2) print(str3) Output:- Hello, playgroun Hello, playgro llo, playground