string = string.substring(0, (string.length() - 1));
I'm using this in my code, it's easy and simple. it only works while the String is > 0. I have it connected to a button and inside the following if statement
if (string.length() > 0) {
string = string.substring(0, (string.length() - 1));
}