strings.TrimSpace
Returns the given string, removing leading and trailing whitespace as defined by Unicode.
Syntax
strings.TrimSpace INPUT
Returns
string
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
Last updated:
March 5, 2025
:
content: Remove "related" array from function and method pages (2fcd21ee5)
Improve this page