strings.TrimRight
Returns the given string, removing trailing characters specified in the cutset.
- Syntax
- strings.TrimRight CUTSET STRING
- Returns
- string
Usage
The strings.TrimRight function returns the given string, removing trailing characters specified in the cutset. The function converts the arguments to strings if possible.
Examples
{{ strings.TrimRight "a" "abba" }} → abbConverting non-string arguments:
{{ strings.TrimRight 54 12345 }} → 123 (string)
{{ strings.TrimRight "eu" true }} → trLast updated:
October 28, 2026
:
content: Apply style guide to strings functions (d6de31ebd)
Improve this page