C5_RTRIM

 RTRIM()
 Remove trailing spaces from a character string
------------------------------------------------------------------------------
 Syntax

     RTRIM(<cString>) --> cTrimString

 Arguments

     <cString> is the character string to be copied without trailing
     spaces.

 Returns

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

 Description

     RTRIM() is a character function that formats character strings.  It is
     useful when you want to delete trailing spaces while concatenating
     strings.  This is typically the case with database fields which are
     stored in fixed-width format.  For example, you can use RTRIM() to
     concatenate first and last name fields to form a name string.

     RTRIM() is related to LTRIM() which removes leading 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.  RTRIM() is exactly the same as
     TRIM() in function.

 Notes

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

 Examples

     .  This is a user-defined function in which RTRIM() formats city,
        state, and zip code fields for labels or form letters:

        FUNCTION CityState(cCity, cState, cZip)
           RETURN RTRIM(cCity) + ", " ;
            + RTRIM(cState) + "  " + cZip

     .  In this example the user-defined function, CityState(),
        displays a record from Customer.dbf:

        USE Customer INDEX CustName NEW
        SEEK "Kate"
        ? CityState(City, State, ZipCode)
        // Result: Athens, GA 10066

 Files   Library is CLIPPER.LIB.

See Also: PAD() SUBSTR() TRIM()

 

One response to “C5_RTRIM

  1. Pingback: SP_RJUST | Viva Clipper !

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.