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
The global dropLast() function works on sequences and therefore on Strings:
dropLast()
var expression = "45+22" expression = dropLast(expression) // "45+2" // in Swift 2.0 (according to cromanelli's comment below) expression = String(expression.characters.dropLast())