Since you are using 4.02, for about the same cost in code you could just use the Strip() UDF. Being a little more generic, you might be able to reuse it for other things in your script.

http://www.scriptlogic.com/Kixtart/FunctionList.asp?FT=String%20-and-%20Array%20Functions

New Mexico Mark