Replacing individual characters in a variable...

A

Anonymous

Guest
I have a good one... I think..

How would one scan a variable say:

$ItemName = ("This Name");

and change it to $ItemName = ("This+Name");

and make it dynamic so that no matter what the $ItemName is, it would change any space to a plus sign.

Thanks,

Bill Strong
 
Nevermind... after tons of tries... I found a work-around. I had some coding screwed up & it originally didn't understand the plus symbol... now it does..
 
Just curious, you using ereg/preg match or some function or loop you made yourself?
 
Neither. The actual item that is using the output had the ability to handle the conversion of the space to a plus symbol. I just had to change some settings.. :)
 
Back
Top