CitectVBA Programming Reference > CitectVBA Function Reference > String Functions > RTrim

RTrim

Strips any trailing spaces from Strvariable.

Syntax

RTrim(Str)

Str:

A string or expression that can represent a valid text value.

Return Value

Returns a String.

Related Functions

LTrim | Trim

Example

Dim strTest as String
Dim strResult as String
Dim lngStartLength as Long
Dim lngFinishLength as Long
strTest = "CitectVBA "
lngStartLength = Len(strTest) ' returns 14
strResult = RTrim(strTest) ' returns "CitectVBA"
lngStringLength = Len(strResult) ' returns 9