hugo/docs/content/en/functions/strings/TrimSpace.md
2024-11-13 11:07:57 +01:00

739 B

title description categories keywords action
strings.TrimSpace Returns the given string, removing leading and trailing whitespace as defined by Unicode.
related returnType signatures
functions/strings/Chomp
functions/strings/Trim
functions/strings/TrimLeft
functions/strings/TrimPrefix
functions/strings/TrimRight
functions/strings/TrimSuffix
string
strings.TrimSpace INPUT

{{< new-in 0.136.3 >}}

Whitespace characters include \t, \n, \v, \f, \r, and characters in the Unicode Space Separator category.

{{ strings.TrimSpace "\n\r\t   foo   \n\r\t" }} → foo