In this tutorial, we are going to learn about how to remove the last character of a string in Swift language.
To remove the last character of a string, we can use the built-in
removeLast() method in Swift.
Here is an example, that removes the last character
d from the following string:
var str = "Fun World" str.removeLast() print(str)
removeLast()method modifies the original string.
Swift version: 5.1