strings.CountWords
Returns the number of words in the given string.
Syntax
strings.CountWords STRING
Returns
int
Alias
countwords
{{ "Hugo is a static site generator." | countwords }} → 6Last updated:
December 11, 2025
:
content: Standardize string function signatures (5751c37cc)
Improve this page