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