wordCount static method

int wordCount(
  1. String? html
)

Number of whitespace-separated words in html.

Implementation

static int wordCount(String? html) => toPlainText(html).split(RegExp(r"\s+")).where((String w) => w.trim().isNotEmpty).length;