JavaScript chop
!No description available for chop. @php.js developers: Please update the function summary text file.
1 2 3 4 56 7 8 9 1011 | function chop (str, charlist) { // !No description available for chop. @php.js developers: Please update the function summary text file. // // version: 1109.2015 // discuss at: http://phpjs.org/functions/chop // + original by: Paulo Freitas // - depends on: rtrim // * example 1: rtrim(' Kevin van Zonneveld '); // * returns 1: ' Kevin van Zonneveld' return this.rtrim(str, charlist);} |
Examples
Running
1 | rtrim(' Kevin van Zonneveld '); |
Should return
1 | ' Kevin van Zonneveld' |
Dependencies
In order to use this function, you also need:
Open syntax issues
php.js uses JsLint to help us keep our code consistent and prevent some common bugs.
Eventually we want all code to pass or at least take into consideration most fixes suggested by JsLint, following this JsLint configuration we’ve decided on.
Authors
Thanks to the following developers, you get to have chop goodness in JavaScript.

@ Kevin: Hmm, now I see that there's no need to send null if charlist is undefined, rtrim() itself should avoid any problems. ;)
Kevin van Zonneveld
10 Dec '08