Question : how to delete last char from stringbuilder
Answered by : excited-eagle-zkh0gv6j7q8i
if(sb.length() > 0){ sb.deleteCharAt(sb.length() - 1);
}
Source : | Last Update : Sat, 06 Mar 21
Question : StringBuilder java pop back
Answered by : amused-angelfish-t2u0cfjorz8d
sb.setLength(sb.length() - 1);
Source : https://stackoverflow.com/questions/3395286/remove-last-character-of-a-stringbuilder | Last Update : Mon, 22 Jun 20
Question : string remove last character
Answered by : crowded-cheetah-r5irch97wadz
public static String removeLastCharacter(String str) { String result = null; if ((str != null) && (str.length() > 0)) { result = str.substring(0, str.length() - 1); } return result;
}
Source : https://www.xenovation.com/blog/development/java/remove-last-character-from-string-java | Last Update : Mon, 06 Apr 20