remove only last character string js code example Example: javascript remove last character from string str = str.substring(0, str.length - 1);