Skip to main content
Home / Code Snippets / JavaScript / Remove the Last Character from a String

Remove the Last Character from a String

var origString = 'Happy Dance7';
var trimmedString = origString.substring(0, origString.length-1);
console.log(trimmedString);
// 'Happy Dance'
icon-link icon-logo-star icon-search icon-star