First rule – Never trust your users. Here is the tip to remove spaces from string.
Run-If: 'FIELD' LIKE "% "
Set-Field: zInt = LENGTH($FIELD$)
Set-Field: Field = SUBSTR($FIELD$,0,zInt-1)
Set-Field: Field = LTRIM(RTRIM($FIELD$))
Set-Field: REPLACE($FIELD$," ","")
In the end, it really depends on you. If you need remove all spaces use 2, in case of all spaces then 3.