---
title: "Format.trim ViewHelper <f:format.trim>"
manual: "Fluid ViewHelper Reference"
version: "main"
permalink: "https://docs.typo3.org/permalink/t3viewhelper:typo3fluid-fluid-format-trim@main"
source: "Global/Format/Trim.rst"
modified: "2026-09-17T05:12:06+00:00"
---

# Format.trim ViewHelper `<f:format.trim>`

This ViewHelper strips whitespace (or other characters) from the beginning and end of a string.

Possible sides are:

-   **`both` (default)**

    Strip whitespace (or other characters) from the beginning and end of a string

-   **`left` or `start`**

    Strip whitespace (or other characters) from the beginning of a string

-   **`right` or `end`**

    Strip whitespace (or other characters) from the end of a string

Go to the source code of this ViewHelper: [Format\\TrimViewHelper.php (GitHub)](https://github.com/TYPO3/Fluid/blob/main/src/ViewHelpers/Format/TrimViewHelper.php).

## Arguments of the `<f:format.trim>` ViewHelper

-   **characters**

    -   *Type:* string

    Optionally, the stripped characters can also be specified using the characters parameter. Simply list all characters that you want to be stripped. With .. you can specify a range of characters.

-   **side**

    -   *Type:* string
    -   *Default:* 'both'

    The side to apply, must be one of this' CASE\_\* constants. Defaults to both application.

-   **value**

    -   *Type:* string

    The string value to be trimmed. If not given, the evaluated child nodes will be used.
