---
title: "Feature: #99285 - Add Fluid TrimViewHelper"
manual: "TYPO3 Core Changelog"
version: "main"
permalink: "https://docs.typo3.org/permalink/changelog:feature-99285-1670321970"
source: "Changelog/12.2/Feature-99285-AddFluidTrimViewhelper.rst"
typo3-version: "12.2"
typo3-major: 12
type: "feature"
issue: 99285
forge: "https://forge.typo3.org/issues/99285"
tags: ["Fluid", "Frontend", "ext:fluid"]
rendered: "2026-09-20T18:31:11+00:00"
---

# Feature: #99285 - Add Fluid TrimViewHelper {#feature-99285-1670321970}

See [forge#99285](https://forge.typo3.org/issues/99285)

## Description {#description}

A trim ViewHelper to trim strings is now available.

Possible sides are:

-   `both` Strip whitespace (or other characters) from the beginning and end of a string
-   `left` Strip whitespace (or other characters) from the beginning of a string
-   `right` Strip whitespace (or other characters) from the end of a string

### Examples {#examples}

#### Trim from both sides {#trim-from-both-sides}

```html
#<f:format.trim>   String to be trimmed.   </f:format.trim>#
```

Results in the output:

```text
#String to be trimmed.#
```

#### Trim only one side {#trim-only-one-side}

```html
#<f:format.trim side="right">   String to be trimmed.   </f:format.trim>#
```

Results in the output:

```text
#   String to be trimmed.#
```

#### Trim special characters {#trim-special-characters}

```html
#<f:format.trim characters=" St.">   String to be trimmed.   </f:format.trim>#
```

Results in the output:

```text
#ring to be trimmed#
```

## Impact {#impact}

The new ViewHelper can be used in all new projects. There is no interference
with any part of existing code.
