RTrim, RTrim$ (functions)

Syntax

RTrim[$](text)

Description

Returns a string with the trailing spaces removed.

Comments

RTrim$ returns a String, whereas RTrim returns a String variant.

Null is returned if text is Null.

Example

This example displays a left-justified string and its RTrim result.

Const crlf = Chr$(13) + Chr$(10)

Sub Main()
  txt$ = "     This is text           "
  tr$ = RTrim(txt$)
  MsgBox "Original ->" & txt$ & "<-" & crlf & "Right Trimmed ->" & tr$ & "<-"
End Sub

See Also

LTrim, LTrim$ (functions); Trim, Trim$ (functions).

More information

R