TRIM
A text without spaces at its ends, and with single spaces between its words.
Group: Text. Compatible with DAX.
Syntax
TRIM ( <text> )
| Parameter | Type | Description |
|---|---|---|
text | Text | The 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 withSUBSTITUTEfirst. - 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 ( " " )
)
| Trimmed | Length after | Spaces only |
|---|---|---|
| Bergen plant | 1 | (empty text) |
Related functions
SUBSTITUTE, LEN, UNICHAR.