Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
Quick and easy question i'm sure, but how can I chop off the last 4 characters from a string using chop.
I can do this:
chop($string); chop($string); chop($string); chop($string);
Thats a little bit ugly though.
I realise I can probably use substr, but wondered if there was a cool way to do it with chop.
Thanks,
Tom
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: chopping lots of characters
by hmerrill (Friar) on Jun 24, 2004 at 12:12 UTC | |
by Abigail-II (Bishop) on Jun 24, 2004 at 12:38 UTC | |
Re: chopping lots of characters
by Abigail-II (Bishop) on Jun 24, 2004 at 11:45 UTC | |
by Anonymous Monk on Jun 24, 2004 at 11:52 UTC | |
Re: chopping lots of characters
by dragonchild (Archbishop) on Jun 24, 2004 at 12:33 UTC | |
by Anonymous Monk on Jun 25, 2004 at 08:39 UTC | |
Re: chopping lots of characters
by japhy (Canon) on Jun 24, 2004 at 12:50 UTC | |
Re: chopping lots of characters
by Fletch (Bishop) on Jun 24, 2004 at 11:57 UTC |
Back to
Seekers of Perl Wisdom