Click or drag to resize

RTrim Function

X#
Remove trailing spaces from a string.

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.19
Syntax
 FUNCTION RTrim(
	cString AS STRING
) AS STRING
Request Example View Source

Parameters

cString
Type: String
The string to trim.

Return Value

Type: String
cString with the trailing spaces removed.
If cString is a NULL_STRING or all spaces, RTrim() returns a NULL_STRING.
Remarks
RTrim() is the same as Trim(). See Trim() for details.
Examples
This is a function in which RTrim() formats city, state, and zip code fields for labels or form letters:
X#
1FUNCTION CityState(cCity, cState, cZip)
2    RETURN RTrim(cCity) + ", " ;
3            + RTrim(cState) + "  " + cZip
To complete the example the function, CityState(), displays a record from CUSTOMER.DBF:
X#
1USE customer INDEX custname NEW
2SEEK "Kate"
3? CityState(City, State, ZipCode)    // Athens, GA 10066
See Also