Power Fx function
TrimEnds — Power Fx function reference
Trim leading/trailing spaces only.
Syntax
powerfx
TrimEnds( Text )
Examples
powerfx
TrimEnds(" a b ")→ "a b"
powerfx
TrimEnds(txtCode.Text)
powerfx
Len(TrimEnds(txtNotes.Text)) = 0
Common mistakes & gotchas
- Unlike Trim, TrimEnds preserves repeated spaces in the middle of the text — useful when interior whitespace is meaningful, e.g. preformatted codes.
- Neither Trim nor TrimEnds touches line breaks inside multi-line text, only literal spaces at the very start/end of the whole string.
Related Power Fx functions
From Text