You want to remove leading and trailing spaces from last names. You can create a user-defined function named RemoveSpaces to perform the LTRIM and RTRIM functions. When you configure the user-defined function, you enter the following expression:
LTRIM( RTRIM( name))
After you create the function, you can create the following expression in an Expression transformation to remove leading and trailing spaces from last names:
The user-defined function name is prefaced by :UDF. The port name is LAST_NAME. It is the argument of the expression.