wordCount method
Counts the number of words in a string.
Implementation
int wordCount() {
return trim().isEmpty ? 0 : trim().split(RegExp(r'\s+')).length;
}
Counts the number of words in a string.
int wordCount() {
return trim().isEmpty ? 0 : trim().split(RegExp(r'\s+')).length;
}