thendal
Programmer
- Aug 23, 2000
- 284
Hi all, How can i remove all the special character and spaces from a string.
$test="7797 telegraph rd, apt # B22,city,state";
Output:
7797telegraphrdaptb22citystate
I tried something like this
$test="7797 telegraph rd, apt # B22,city,state";
$test=~s/ //g; #remove all the spaces in the sting
$test=~/(a-zA-Z0-9)/;
$output=$1;
#I try to match alphanumeric alone and capture it a string it didn't work
it prints out null..
any thoughts ..?
Thank you.
$test="7797 telegraph rd, apt # B22,city,state";
Output:
7797telegraphrdaptb22citystate
I tried something like this
$test="7797 telegraph rd, apt # B22,city,state";
$test=~s/ //g; #remove all the spaces in the sting
$test=~/(a-zA-Z0-9)/;
$output=$1;
#I try to match alphanumeric alone and capture it a string it didn't work
it prints out null..
any thoughts ..?
Thank you.