The TRIM() function removes unnecessary spaces from a string, keeping only a single space between words. It removes spaces at the beginning and end of the string and reduces consecutive spaces in the middle to a single space.
Function name:
TRIM()
Syntax
TRIM(text)ℹ Calling function parameters in TimeTonic:
- $field_name = field (link, linked table column, number, selection, formula, text...).
- "free text" = free text to be added between quotation marks.
- do not use quotation marks for numbers.
Parameters
| Parameter | Description |
|---|---|
text |
String to be trimmed. |
Example
TRIM(" Hello World ")Result: "Hello World"
Notes
TRIM()leaves only one space between words and removes leading and trailing spaces.
Return type
The function returns a text string.
The output result type format can be configured in the output field options of the formula editor. For more details, see Output format options in the Formula Column article.
Best practice:
Invisible spaces at the beginning or end of text are a common source of errors in comparisons, conditions, and automations.
It is recommended to use TRIM() before any text comparison