User Tools

Site Tools


syntax:functions:compact

This is an old revision of the document!


Compact(text)

Category: Text function


Description

This function removes repeating whitespace from text, reducing it to a single space. Note that line breaks and other special characters are not counted as whitespace.


Arguments

ArgumentTypeDescription
textTextThe text value to remove repeated spaces from.

Return value type: Text


Remarks

There needs to be two or more repeated spaces in text for this function to have an effect. If text is a string with no spaces or only single spaces within the text no change to text will occur.

As this function reduces repeated spaces to a single space, it cannot be used to completely remove leading and trailing whitespace. For that, use the Trim(text) function.


Examples

compact( 'A           Z') = 'A Z'
compact( 'A       N       Z') = 'A N Z'
len(compact( 'A           Z')) = 3


See also

syntax/functions/compact.1627855335.txt.gz · Last modified: 2021/08/01 18:02 by craigt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki