Skip to main content

This is documentation for Caché & Ensemble.

For information on converting to InterSystems IRIS, see the InterSystems IRIS Adoption Guide and the InterSystems IRIS In-Place Conversion Guide, both available on the WRC Distributions page (login required).

Previous sectionNext section

TRIMF

Removes leading blanks from a string.

Synopsis

TRIMF(string)

Arguments

string An expression that resolves to a string.

Description

The TRIMF function trims blank spaces from the front end of a string (leading blanks). It returns the resulting trimmed string.

You can use the TRIM function to remove blank spaces (or other repetitive characters) from both ends of a string. You can use the TRIMB function to remove blank spaces from the back end of a string (trailing blanks).

You can use the TRIMFS and TRIMBS functions to remove leading or trailing blanks from the elements of a dynamic array.

Examples

The following example uses the TRIMF function to trim leading spaces:

MyVar = TRIMF("  Caché  ")
        ! MyVar contains "  Caché".
PRINT LEN(MyVar),"[":MyVar:"]"
Copy code to clipboard

See Also