This is great function, thanks a lot.

I was wondering why the spaces are not removed with LTRIM() RTRIM(), finally I found it was either CHAR(10) or CHAR(13) instead of CHAR(32).

Thanks.