Trim(string) trims whitespace from both the beginning and the end of a string...there is some other function called replace that might help...but you got to check...the syntax goes like this:
#replace(string, whatstring, withstring [, scope])#
P.S: [optional]
lets say you wanna replace all the occurrences of US in some address string with USA...you write the following:
#replace(address, "US", "USA", "ALL"

#
P.S: ALL is for all occurrences
in your case some thing like this might work

#replace(string, " ", "", "ALL"

#
good luck [sig][/sig]