LeftTrim

Description

Removes spaces from the beginning of a string.

Syntax

LeftTrim ( string {, removeallspaces } )

Argument

Description

string

The string you want returned with leading spaces deleted

removeallspaces

A boolean indicating that all types of spaces should be deleted

Returns

String. Returns a copy of string with leading spaces deleted if it succeeds and the empty string ("") if an error occurs. If string is null, LeftTrim returns null.

Usage

If you do not include the optional removeallspaces argument or its value is false, only the space character (U+0020) is removed from the string.

If the removeallspaces argument is set to true, all types of space characters are removed.

This is a list of white spaces:

Examples

Example 1

This statement returns RUTH when the leading spaces are all space characters:

LeftTrim(" RUTH")

Example 2

This statement returns RUTH when the leading spaces include other types of space characters such as tab characters:

LeftTrim(" RUTH", true)

Example 3

These statements delete leading spaces from the text in the MultiLineEdit mle_name and store the result in emp_name:

string emp_name

emp_name = LeftTrim(mle_name.Text)

See also