string word count in flutter code example Example: dart count words in string return str.split(' ').length;