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

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

# 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"
```
