Answers for "exclude last character in the string and print full string using substring in njavascript"

13

remove last character from string js

var str = "Your string"
str = str.slice(0, -1); 
console.log(str)
//returns "Your strin"
Posted by: Guest on May-23-2020
11

remove last character from string javascript

const text = 'abcdef'
const editedText = text.slice(0, -1) //'abcde'
Posted by: Guest on August-27-2020

Code answers related to "exclude last character in the string and print full string using substring in njavascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language