Answers for "delete the last character of a string"

35

java remove last character from string

String s = "Hello Worlds";
String end = "";
end = s.substring((0, s.length()-1));
Posted by: Guest on October-19-2020
0

Remove the last character from String using Slice

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"
Posted by: Guest on April-25-2022

Code answers related to "delete the last character of a string"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language