RightTrim

Description

Removes spaces from the end of a string.

Syntax

RightTrim ( string )

Argument

Description

string

The string you want returned with trailing blanks deleted

Returns

String. Returns a copy of string with trailing blanks deleted if it succeeds and the empty string ("") if an error occurs. If any argument’s value is null, RightTrim returns null.

Usage

In SBCS environments, the RightTrim and RightTrimW functiones return the same results. Although you can use the RightTrim function in DBCS environments, it cannot remove double-byte spaces. You must use the RightTrimW function to remove double-byte or mixed single-byte and double-byte spaces.

Examples

Example 1

This statement returns RUTH:

RightTrim("RUTH ")

See also