Gossamer Forum
Home : General : Perl Programming :

De-Webifying a string...

Quote Reply
De-Webifying a string...
I've gone brain dead!... I have a string full of web friendly charactors like...

Code:
'
:
&#59;
&

...the normal stuff, there must be a quick parse string to chop things human friendly....


moog
-- I've spent most of my money on beer and women... the rest I just wasted.
Quote Reply
Re: [moog] De-Webifying a string... In reply to
There is a fairly easy way as long as the numeric form is used. This won't work for things like ½ - it would need to be ½

Code:
$string =~ s/&#(\d+);/chr($1)/eg;

Last edited by:

Paul: May 22, 2003, 3:08 PM
Quote Reply
Re: [Paul] De-Webifying a string... In reply to
Doh!... Cheers mate... Wink


moog
-- I've spent most of my money on beer and women... the rest I just wasted.