Languages
[Edit]
EN

JavaScript - remove last character from string

5 points
Created by:
Dexter
660

In JavaScript, it is possible to remove the last character from a string in the following ways.

1. Using String slice() method

Edit

2. Using String substring() method

Edit

3. Using String replace() method with regular expression

Edit

4. Using String replace() method

Edit

Alternative titles

  1. JavaScript - how to chop off last char from string?
  2. How do I trim off last char in JavaScript?
  3. JavaScript - delete last character of string
  4. Slice off last character in js
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

JavaScript - String (popular problems)

JavaScript - remove last character from string
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join