Remove leading spaces from a character string

     LTRIM(<cString>) --> cTrimString


     <cString> is the character string to copy without leading spaces.


     LTRIM() returns a copy of <cString> with the leading spaces removed.  If
     <cString> is a null string ("") or all spaces, LTRIM() returns a null
     string ("").


     LTRIM() is a character function that formats character strings with
     leading spaces.  These can be, for example, numbers converted to
     character strings using STR().

     LTRIM() is related to RTRIM(), which removes trailing spaces, and
     ALLTRIM(), which removes both leading and trailing spaces.  The inverse
     of ALLTRIM(), LTRIM(), and RTRIM() are the PADC(), PADR(), and PADL()
     functions which center, right-justify, or left-justify character strings
     by padding them with fill characters.


     .  Space characters: The LTRIM() function treats carriage
        returns, line feeds, and tabs as space characters and removes these
        as well.


     .  These examples illustrate LTRIM() used with several other

        nNumber = 18
        ? STR(nNumber)                  // Result: 18
        ? LEN(STR(nNumber))            // Result: 10

        ? LTRIM(STR(nNumber))         // Result: 18
        ? LEN(LTRIM(STR(nNumber)))      // Result:  2

 Files   Library is CLIPPER.LIB.



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.