wordCount property

int get wordCount

Implementation

int get wordCount => trim().isEmpty ? 0 : trim().split(RegExp(r'\s+')).length;