--- title: "trim (Calculation expression – cutting off whitespaces)" slug: "calc-function-trim" updated: 2026-05-12T12:41:34Z published: 2026-05-12T12:41:34Z canonical: "docs.lobstersoftware.com/calc-function-trim" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # trim (Calculation expression – cutting off whitespaces) *See also:* [isEmpty (Check for empty)](/v1/docs/en/calc-function-is-empty), [ifEmpty](/v1/docs/en/calc-function-if-empty) > [!NOTE] > The function $trim removes the preceding and following whitespaces (space, tabulator, line break, etc. ) from the transferred text and returns the new text. > > > [!TIP] > > Tooltip > > > > Syntax: *$trim(text)* > > > > | Name | Description | > > | --- | --- | > > | `text` | A text whose leading and attached whitespaces are removed. | > > > > Returns the passed text stripped of preceding and following whitespaces. > > > > Example: $trim( Jonas Abend ) – returns "Jonas Abend" ## Syntax *$trim(text)* ## Parameter | Name | Description | | --- | --- | | text | A text whose leading and attached whitespaces are removed. | ## Return value Returns the transferred text cleared of leading and following whitespaces. ## Example | Syntax | Result | | --- | --- | | $trim(Jonas Abend) | "Jonas Abend" | | $trim( Jonas Abend ) | "Jonas Abend" | | $trim( Jonas Abend ) | "Jonas Abend" | | $trim() | empty/*null* |