CitectVBA Programming Reference > CitectVBA Function Reference > String Functions > LTrim

LTrim

Strips any leading spaces from Str variable.

Syntax

LTrim(Str)

Str:

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

Return Value

Returns a string.

Related Functions

RTrim| 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 = LTrim(strTest) ' returns "CitectVBA"
lngStringLength = Len(strResult) ' returns 9