RTRIM: remove trailing spaces from a string
1> -- RTRIM: remove trailing spaces from a string.
2>
3>
4> DECLARE @STRING_WITH_SPACES VARCHAR(30)
5> DECLARE @STRING_WITHOUT_SPACES VARCHAR(30)
6> SET @STRING_WITH_SPACES = "www.java2s.com "
7>
8> SET @STRING_WITHOUT_SPACES = RTRIM(@STRING_WITH_SPACES)
9>
10> SELECT @STRING_WITH_SPACES + "!"
11> SELECT @STRING_WITHOUT_SPACES + "!"
12> GO
-------------------------------
www.java2s.com !
(1 rows affected)
-------------------------------
www.java2s.com!
(1 rows affected)
1>
Related examples in the same category