JavaScript obtenga el último carácter de cadena
var hello = "Hello World";
var lastCharOfHello=hello.slice(-1);//d
Grepper
var hello = "Hello World";
var lastCharOfHello=hello.slice(-1);//d
var str = "Hello";
var newString = str.substring(0, str.length - 1); //newString = Hell
'abc'.slice(-1); // c
function test(words) {
var n = words.split(" ");
return n[n.length - 1];
}
'abc'.slice(-2);
let str = "12345.00";
str = str.substring(0, str.length - 1);
console.log(str);