Modifier: word_count
Returns the number of words in a given string.
string: There are probably seven words in this sentence.
{{ string | word_count }}
8
Additional Reading
Learn how to use and chain modifiers in the Antlers template guide.