Posted By

jatkins on 07/21/11


Tagged

substr String manipulation substring


Versions (?)

substr (works with negative length values)


 / Published in: JavaScript
 

Released into the public domain.

  1. function substr(str, start, length) {
  2. return str.substring(start, length > 0 ? start + length : str.length + length);
  3. }

Report this snippet  

You need to login to post a comment.