XP is just a number | |
PerlMonks |
Re: Strip non-numericby krujos (Curate) |
on Jan 13, 2003 at 22:50 UTC ( [id://226636]=note: print w/replies, xml ) | Need Help?? |
Try this $var =~ s/\D//g; This (untested) code will remove all non-numeric characters from the string. JoshUpdate: I fixed my type where I left the g off the regexp. Sorry Update:2 I also fixed the /// problem that tall_man pointed out. Thanks.
In Section
Seekers of Perl Wisdom
|
|