LTrim$()

Syntax

LTrim$(Source$)

Remarks

Returns Source$ minus any leading spaces (spaces to the left of the first character). LTrim$() is especially useful for removing the leading space from numeric values that have been converted to strings and for cleaning up user input.

Example

This example converts the numeric variable code to a string and then removes the leading space that was automatically added by Str$(). The variable lastName$ is then joined with code$ and stored in the variable license$.


lastName$ = "Peterson"
code = 1234
code$ = Str$(code)
code$ = LTrim$(code$)
license$ = lastName$ + code$

See Also

InStr(), Left$(), Mid$(), Right$(), RTrim$()