P is for Practical | |
PerlMonks |
Re: How to remove last character of a lineby Polyglot (Chaplain) |
on Mar 23, 2021 at 03:03 UTC ( [id://11130169]=note: print w/replies, xml ) | Need Help?? |
Given:
You can remove the final character by simply saying:
This will remove ANY character, even a newline (\n). But to have a little more precision as to which character you might wish to remove, you could use a substitution:
Blessings, ~Polyglot~
In Section
Seekers of Perl Wisdom
|
|