Count number of words separated by whitespace.
int wordCount(String s) { return s.isEmpty ? 0 : words(s).length; }