$Description =~ tr/-/ /;
$Description =~ tr/,/ /;
$Description =~ tr/./ /;
$Description =~ tr/;/ /;
$Description =~ tr/"/ /;
$Description =~ tr/'/ /;
$Description =~ tr/:/ /;
$Description =~ tr/)/ /;
$Description =~ tr/(/ /;
$Description =~ tr/*/ /;
$Description =~ tr/@/ /;
$Description =~ tr/%/ /;
$Description =~ tr/$/ /;
$Description =~ tr/ /+/;
Is there a better way to do this? Basically I want to remove all the characters and then replace any spaces with a + sign.
ex: I--hope% to get a reply)--"for my question"
TO
I+hope+to+get+a+reply+to+my+question
$Description =~ tr/,/ /;
$Description =~ tr/./ /;
$Description =~ tr/;/ /;
$Description =~ tr/"/ /;
$Description =~ tr/'/ /;
$Description =~ tr/:/ /;
$Description =~ tr/)/ /;
$Description =~ tr/(/ /;
$Description =~ tr/*/ /;
$Description =~ tr/@/ /;
$Description =~ tr/%/ /;
$Description =~ tr/$/ /;
$Description =~ tr/ /+/;
Is there a better way to do this? Basically I want to remove all the characters and then replace any spaces with a + sign.
ex: I--hope% to get a reply)--"for my question"
TO
I+hope+to+get+a+reply+to+my+question