See the Trim, LTrim, and RTrim functions.

Trim takes care of leading and trailing spaces.
LTrim takes care of leading spaces.
RTrim takes care of trailing spaces.