in reply to String manipulation
Another way, borrowing Athanasius' alternation:
use warnings; use strict; while (<DATA>) { s/(\d+)(th|st|nd|rd)/$1/; print; } __DATA__ December 14th 2012 December 21st 2012 December 22nd 2012
See also:
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: String manipulation
by nvivek (Vicar) on Dec 17, 2012 at 05:28 UTC |
In Section
Seekers of Perl Wisdom