### LTrim (str)

LTrim and TrimLeft (str) are equivalent functions. However, LTrim is preferred in Basic syntax, whereas TrimLeft is preferred in Crystal syntax.

##### Argument

str is a text String value

##### Returns

String value.

##### Action

LTrim removes all spaces stored to the left of the given string and returns it.

##### Typical uses

- Use this function any time there are leading blanks in a text object that may interfere with an alignment of text strings, a character count, or with a calculation (if the string is eventually converted to a Number).
- Use whenever you combine (concatenate) justified text strings and want to have the proper spacing between strings.

##### Examples

The following examples are applicable to both Basic and Crystal syntax:

`LTrim(" Al/4520/B12")`

Returns "A1/4520/B12".

`LTrim(" 200")`

Returns "200", where the text string " 200" is right-justified with leading blanks.

You have two right-justified database fields, {file.FOOD1} and {file.FOOD2}. Each field can hold up to 15 characters. {file.FOOD1} contains the word bread and {file.FOOD2} contains the word butter. If you were to print these words, they would appear like this:

" bread"

" butter"

For each 15-character field the database includes the field value, right-justified plus enough blank spaces to fill up the field. To use these words without the leading spaces (to create the expression bread and butter, for example) use the LTrim function in the following manner:

`LTrim({file.FOOD1}) + " and " + LTrim({file.FOOD2})`

Returns "bread and butter".

The spaces enclosed in the quotation marks before and after the word and assure that there is the correct spacing between the three words in the resulting sentence.

##### Comments

This function is designed to work like the Visual Basic function of the same name.

###### Related topics

Trim (str)

RTrim (str)

Seagate Software, Inc. http://www.seagatesoftware.com Please send comments to: techpubs@seagatesoftware.com