---
title: "trim_suffix | Grafana Agent documentation"
description: "Learn about trim_suffix"
---

# trim\_suffix

`trim_suffix` removes the suffix from the end of a string.

## Examples

Alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```alloy
> trim_suffix("helloworld", "world")
"hello"
```
