Gossamer Forum
Home : General : Perl Programming :

Howto strip underscore '_'

Quote Reply
Howto strip underscore '_'
Can anyone post the pattern matching code really quick on howto strip a '_' (underscore) from a string?

I've tried searching through the forums and haven't had any luck.

Thanks,



------------------
Jacob Wheeler
jacob@123webmaster.com
http://www.123webmaster.com
http://www.online-freebies.com
ICQ:#390147
Quote Reply
Re: Howto strip underscore '_' In reply to
Nevermind.... I figured it out.



------------------
Jacob Wheeler
jacob@123webmaster.com
http://www.123webmaster.com
http://www.online-freebies.com
ICQ:#390147
Quote Reply
Re: Howto strip underscore '_' In reply to
hi,
i seem to have a similar problem,
i need a code to replace any spaces in an form entry with ( _ )underscores.

like if $FORM{'title'} was (Star Wars),
i need the script to convert it to (Star_Wars). the reason for that is that i will be using the same entry ( which will be the title of the message (Star Wars) , i will use it to generate a an HTML page with the name (Star_Wars.html)

i hope i explained this clearly,
can you help me with this ?

Thanks,
Laith
Quote Reply
Re: Howto strip underscore '_' In reply to
Try this:

Code:
$FORM{'title'} =~ s/ /_/g;

It should work.

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: Howto strip underscore '_' In reply to
Thanks , its working now.