countWord method

int countWord(
  1. String word
)

Implementation

int countWord(String word) => RegExp('\\b\$word\\b').allMatches(this).length;