User Tools

Site Tools



Category: Text function


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.


textTextThe text value to remove repeated spaces from.

Return value type: Text


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.


compact( 'A           Z') //Returns 'A Z'
compact( 'A       N       Z') //Returns 'A N Z'
len(compact( 'A           Z')) //Returns 3 ('A' space 'Z')

See also

syntax/functions/compact.txt · Last modified: 2021/08/14 21:58 by craigt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki