Remove last character from string javascript

During the work, sometimes we need to delete the last character in the javascript string. So how can that work? You can use it here:

var newStr = str.substring(0, str.length-1);

 

Add a Comment

Your email address will not be published. Required fields are marked *