Posted By

Roshambo on 02/11/10


Tagged


Versions (?)

JavaScript implementation of Perl’s Chop


 / Published in: JavaScript
 

Simply removes the last character from a string.

  1. String.prototype.chop = function() {
  2. return this.substring(0, this.length - 1);
  3. }

Report this snippet  

You need to login to post a comment.