UCTruncate (open)

Truncate a text if it's too long, adding an ellipsis ('…') if truncated. Whitespace between the text and ellipsis will be removed.

Syntax

// Core function, no LOADLIB necessary

STRING FUNCTION UCTruncate(STRING text, INTEGER maxlen)

Parameters

STRING text

Text to check and truncate if needed

INTEGER maxlen

Maximum text length (in codepoints)

Return value

STRING

The text, truncated if needed, never longer than 'maxlen' in codepoints. If only whitespace remains after truncating, an empty string will be returned