Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

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"
Source by herewecode.io #
 
PREVIOUS NEXT
Tagged: #Remove #character #String #Slice
ADD COMMENT
Topic
Name
3+7 =