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
Question : how to slice/trim/remove last character in string
Answered by : talented-tarantula-54eiz40yoq93
let str = "12345.00";
str = str.slice(0, -1);
Source : https://stackoverflow.com/questions/952924/javascript-chop-slice-trim-off-last-character-in-string | Last Update : Tue, 23 Feb 21
Question : Remove the last character from String using Slice
Answered by : g-hemanth-tigga
const bookName = 'Atomic Habits' // 13 characters (indexes between 0 and 12)
const newBookName = bookName.slice(0, bookName.length - 1) // Between (0 and 12)
console.log(newBookName)
// Output: "Atomic Habit"
Source : https://herewecode.io/blog/remove-last-character-string-javascript/ | Last Update : Mon, 02 May 22