hugo/docs/content/en/functions/strings/CountWords.md
2023-10-20 09:43:56 +02:00

659 B

title linkTitle description categories keywords menu function relatedFunctions aliases
strings.CountWords countwords Counts the number of words in a string.
functions
docs
parent
functions
aliases returnType signatures
countwords
int
strings.CountWords INPUT
len
strings.Count
strings.CountRunes
strings.CountWords
strings.RuneCount
/functions/countwords

The template function works similar to the .WordCount page variable.

{{ "Hugo is a static site generator." | countwords }}
<!-- outputs a content length of 6 words.  -->