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

# trim\_prefix

`trim_prefix` removes the prefix from the start of a string. If the string does not start with the prefix, the string is returned unchanged.

## Examples

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

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