OpenBI Docs Buy

TRIM

A text without spaces at its ends, and with single spaces between its words.

Group: Text. Compatible with DAX.

Syntax

TRIM ( <text> )
ParameterTypeDescription
textTextThe text to tidy.

Returns

Text. The text without spaces at its ends, and with one space wherever there were several.

Remarks

  • Only the ordinary space is removed. Tabs and non-breaking spaces (UNICHAR ( 160 )) stay: take them out with SUBSTITUTE first.
  • A text of spaces only becomes empty text; a blank gives BLANK.

Examples

Extra spaces

EVALUATE
ROW (
    "Trimmed", TRIM ( "  Bergen   plant " ),
    "Length after", LEN ( TRIM ( "  x  " ) ),
    "Spaces only", TRIM ( "   " )
)
TrimmedLength afterSpaces only
Bergen plant1(empty text)

SUBSTITUTE, LEN, UNICHAR.

Last updated · OpenBI Studio 0.3.74