Skip to content Skip to footer navigation
You are reading the Statamic 6 Alpha docs. πŸ‘€

Word Count Modifier

Returns the number of words in a given string.

string: There are probably seven words in this sentence.
{{ string | word_count }}
{{ Statamic::modify($string)->wordCount() }}
8