aboutsummaryrefslogtreecommitdiffhomepage
path: root/docs/content/en/functions/strings/TrimSuffix.md
blob: 704bbd2d22de8dfd64b1d20447b07aca7f30cdc7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
---
title: strings.TrimSuffix
description: Returns the given string, removing the suffix from the end of the string.
categories: []
keywords: []
action:
  aliases: []
  related:
    - functions/strings/Chomp
    - functions/strings/Trim
    - functions/strings/TrimLeft
    - functions/strings/TrimPrefix
    - functions/strings/TrimRight
  returnType: string
  signatures: [strings.TrimSuffix SUFFIX STRING]
aliases: [/functions/strings.trimsuffix]
---

```go-html-template
{{ strings.TrimSuffix "a" "aabbaa" }} → aabba
{{ strings.TrimSuffix "aa" "aabbaa" }} → aabb
{{ strings.TrimSuffix "aaa" "aabbaa" }} → aabbaa
```