Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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
7+8 =