---
title: "duplicate-trim-cutset"
description: "Detect duplicate characters in string trim cutsets."
image: "https://strider.gempir.com/og.png"
---

> Documentation Index
> Fetch the complete documentation index at: https://strider.gempir.com/llms.txt
> Use this file to discover all available pages before exploring further.

# duplicate-trim-cutset

**Default severity:** `warning`

`strings.Trim`, `TrimLeft`, and `TrimRight` interpret their second argument as
a set of runes, not as a prefix or suffix. Duplicate runes have no effect and
often reveal that `TrimPrefix` or `TrimSuffix` was intended.

## Bad

```go
strings.TrimLeft(value, "letter")
```

## Good

```go
strings.TrimPrefix(value, "prefix")
```

Source: https://strider.gempir.com/analyzers/duplicate-trim-cutset/index.mdx
