strings.TrimRight.md (631B)
1 ---
2 title: strings.TrimRight
3 description: Returns a slice of a given string with all trailing characters contained in the cutset removed.
4 date: 2017-02-01
5 publishdate: 2017-02-01
6 lastmod: 2017-02-01
7 categories: [functions]
8 menu:
9 docs:
10 parent: "functions"
11 keywords: [strings]
12 signature: ["strings.TrimRight CUTSET STRING"]
13 workson: []
14 hugoversion:
15 relatedfuncs: [strings.TrimRight]
16 deprecated: false
17 aliases: []
18 ---
19
20 Given the string `"abba"`, trailing `"a"`'s can be removed a follows:
21
22 {{ strings.TrimRight "a" "abba" }} → "abb"
23
24 Numbers can be handled as well:
25
26 {{ strings.TrimRight 12 1221341221 }} → "122134"