in reply to a farewell to chop
Which effectively truncates the last character, as chop() does. To me, that makes almost as much sense as chop does though, so beyond golf or obfuscation, I personally won't miss it much (I don't have that many legacy scripts that need to hack off one char).A chop() method in the string class with variable length would be nice as well :)$str='abcde'; $str = substr $str,0,(length($str)-1); print $str;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Make things a *little* easier
by mdillon (Priest) on Sep 11, 2002 at 20:52 UTC | |
by John M. Dlugosz (Monsignor) on Sep 12, 2002 at 14:49 UTC | |
by mdillon (Priest) on Sep 12, 2002 at 15:37 UTC | |
by Aristotle (Chancellor) on Sep 12, 2002 at 16:06 UTC | |
by John M. Dlugosz (Monsignor) on Sep 12, 2002 at 20:03 UTC | |
|
Re: Make things a *little* easier
by John M. Dlugosz (Monsignor) on Sep 11, 2002 at 20:46 UTC |