Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: the end of a wordby Ionitor (Scribe) |
on Jul 22, 2002 at 20:24 UTC ( [id://184221]=note: print w/replies, xml ) | Need Help?? |
Well, if all you want to do is remove the last character of a string, regardless of what it is, then: will work. However, more is needed if you're looking to eliminate an indetermined amount of junk. A general regex to customize would be: This will remove any non-letters from the end of the variable (the ^ negates the [] character class). If there are other valid word letters, change the character class as needed.
In Section
Seekers of Perl Wisdom
|
|