freelanceprogrammers.org Forum Index » Perl

deleting unwanted characters from string


View user's profile Post To page top
rand_mcneely Posted: Wed Feb 06, 2002 4:05 am


Joined: 06 Feb 2002

Posts: 5
deleting unwanted characters from string
It may be a line feed ( ). If you want to get
rid of everything but numbers and chars, try
this:<br><br>$line =~ s/[^a-z0-9]//ig;<br><br>If you want to add in
other chars, just put them inside of the brackets (make
sure to escape special chars such as `$`).<br><br>This
stuff is pretty straight forward, just read the
perlrequick POD (available on any decent Perl site or with
your Perl distribution).
Reply with quote
Send private message
View user's profile Post To page top
sillypet_101 Posted: Fri Feb 15, 2002 1:48 am


Joined: 15 Feb 2002

Posts: 2
deleting unwanted characters from string
Is there a way to just check for the content to make sure everything is chars
and numbers?
Reply with quote
Send private message
View user's profile Post To page top
sillypet_101 Posted: Fri Feb 15, 2002 1:48 am


Joined: 15 Feb 2002

Posts: 2
deleting unwanted characters from string
Is there a way to just check for the content to make sure everything is chars
and numbers?
Reply with quote
Send private message
Post new topic Reply to topic
Display posts from previous:   
 

All times are GMT
Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Freelace Website Designer - Customer web design and software building.
China Wholesale - Electronics Products
Character Studio - Tutorials and Help