getNumberOfWords static method

int getNumberOfWords(
  1. String s
)

Implementation

static int getNumberOfWords(String s) {
  final RegExp regExp = RegExp(r"[\w-._]+");
  final Iterable matches = regExp.allMatches(s);
  return matches.length;
}