strings.TrimSuffix
Returns the given string, removing the suffix from the end of the string.
- Syntax
- strings.TrimSuffix SUFFIX STRING
- Returns
- string
Usage
The strings.TrimSuffix function returns the given string, removing the suffix from the end of the string. If STRING does not end with SUFFIX, the function returns STRING unchanged.
Examples
{{ strings.TrimSuffix "a" "aabbaa" }} → aabba
{{ strings.TrimSuffix "aa" "aabbaa" }} → aabb
{{ strings.TrimSuffix "aaa" "aabbaa" }} → aabbaaLast updated:
November 8, 2026
:
content: Remove categories from front matter (1cc1dd83a)
Improve this page