Gossamer Forum
Home : General : Perl Programming :

Can this be simplified?

Quote Reply
Can this be simplified?
 
$Title =~ tr/A-Z/a-z/; #this converts to small caps
$Title =~ s/[0-9]//g; #this removes all numbers
$Title =~ s/[&$\#.!',"(*)\:;]//g; #this removes some other characters
$Title =~ s/ /-/g; #this replaces blank with hyphen

I want all the numbers and characters gone, spaces replaced with hyphen (and possibly 2-3 series of hyphens replaced with one hyphen) and title converted to lower case.

Thanks
Subject Author Views Date
Thread Can this be simplified? socrates 4214 Nov 17, 2005, 1:20 AM
Thread Re: [socrates] Can this be simplified?
Hargreaves 4085 Nov 17, 2005, 2:36 AM
Thread Re: [Hargreaves] Can this be simplified?
socrates 4075 Nov 22, 2005, 6:20 PM
Post Re: [socrates] Can this be simplified?
Hargreaves 4051 Nov 23, 2005, 2:38 AM