js remove the last character of a string
var str = 'mystring';
// the character 'g' will be removed
str = str.slice(0, -1);var str = "Your string"
str = str.slice(0, -1);
console.log(str)
//returns "Your strin"str=str.slice(0, -1);let str = "12345.00";
str = str.substring(0, str.length - 1);
console.log(str);"somestring0".slice(0, -1)
// "somestring"ASDF
Also in JavaScript:
- npm check updates
- new features of angular 11
- lodash merge
- js open link onmouseup
- replacing a value in string using aregular expression pyhton
- jquery make readonly textbox
- multiple case switch javascript
- math.floor js
- js running function as parameter
- how to disable menu bar in browser using javascript
- reactnode prop-types
- enable version 12 node glitch
- require is not defined javascript
- capitalize
- strict equality
- port already in use node js
- angular add bootstrap
- jquery advace
- jquery get selected option value
- javascript email validation
- /on in jquery
- convert json to 2d array
- how to swap two elements in an array js
- set css variable from javascript