Compartir a través de


LTRIM( ) Function

Removes all leading spaces or parsing characters from the specified character expression, or all leading zero (0) bytes from the specified binary expression.

LTRIM(Expression [, nFlags] [, cParseChar [, cParseChar2 [, ...]]])

Parameters

  • Expression
    Specifies an expression of Character or Varbinary type to remove leading spaces or 0 bytes from, respectively.

  • nFlags
    Specifies if trimming is case-sensitive when one or more parse characters (cParseChar, cParseChar2, … are included. Trimming is case-sensitive if nFlags is zero or is omitted. Trimming is case-insensitive if nFlags 1.

  • cParseChar [, cParseChar2 [, ...]]
    Specifies one or more character strings that are trimmed from the beginning of cExpression. If cParseChar isn't included, then leading spaces or 0 bytes are removed from Expression.

    Note   The maximum number of strings permitted in cParseChar is 23.

Return Value

Character or Varbinary. LTRIM( ) returns the specified expression without leading spaces or parsing characters, or 0 bytes.

Remarks

LTRIM( ) is particularly useful for removing the leading spaces that are inserted when you use the STR( ) function to convert a Numeric value to a Character string.

Example

STORE 'Redmond' TO gcCity
STORE '   Washington' TO gcState
CLEAR
? gcCity, gcState  && Displays Redmond   Washington
? gcCity, LTRIM(gcState)  && Displays Redmond Washington

See Also

Reference

ALLTRIM( ) Function

RTRIM( ) Function

STR( ) Function

TRIM( ) Function

Other Resources

Functions