CT_EXPAND

 EXPAND()
 Expands a string by inserting characters
------------------------------------------------------------------------------
 Syntax

     EXPAND(<cString>,[<nNumber>],[<cCharacter|    nCharacter>])
        --> cString

 Arguments

     <cString>  Designates the string that is processed.

     <nNumber>  Designates the number of the <cCharacter|nCharacter>
     characters that are inserted between each character in the <cString>.
     The default value is one character.

     <cCharacter|nCharacter>  Designates the character that is inserted
     between each character in <cString>.  The default value is a space,
     CHR(32).

 Returns

     The processed <cString> is returned.

 Description

     EXPAND() can be used to justify text output, although the text is stored
     normally.  This saves memory capacity with text constants or in
     databases.

 Notes

     .  Expansion only takes place when the <cString> contains at
        least two characters.

     .  To fill out a character string at the ends, use the PADLEFT()
        and PADRIGHT() functions.

 Examples

     .  Use the default value and expand with one space:

        ? EXPAND("123456")               // "1 2 3 4 5 6"

     .  Expand with two spaces:

        ? EXPAND("123456", 2)            // "1  2  3  4  5  6"

     .  Expand with a ".":

        ? EXPAND("123456", ".")          // "1.2.3.4.5.6"

     .  Expand with two "."s:

        ? EXPAND("123456", 2, ".")       // "1..2..3..4..5..6"

See Also: CHARSPREAD() PADLEFT() PADRIGHT()

 

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.