xxxxxxxxxx
let str = "12345.00";
str = str.substring(0, str.length - 1);
xxxxxxxxxx
var str = 'mystring';
// the character 'g' will be removed
str = str.slice(0, -1);
xxxxxxxxxx
const text = 'abcdef'
const editedText = text.slice(0, -1) //'abcde'
xxxxxxxxxx
var str = "Your string"
str = str.slice(0, -1);
console.log(str)
//returns "Your strin"
xxxxxxxxxx
var str = "Hello";
var newString = str.substring(0, str.length - 1); //newString = Hell
xxxxxxxxxx
let str = "exampleString";
let newStr = str.slice(0, -1);
console.log(newStr);
xxxxxxxxxx
let str = "meguenniwalid";
//will remove d from str by using slice()
str = str.slice(0, -1);
//output
console.log(str);
//meguenniwali