Microsoft SQL Server RTrim


Example

Returns a character expression (varchar or nvarchar) after removing all trailing white spaces, i.e., spaces from the right end of the string up until the first non-white space character to the left.

Parameters:

  1. character expression. Any expression of character or binary data that can be implicitly converted to varcher, except text, ntext and image.
SELECT RTRIM('This is my string     ') -- Returns 'This is my string'