characterCount property

int get characterCount

Getter which returns the count of the human readable characters.

Using the following regular expression to remove all html tags, tabs, new lines, spaces and html entities: RegExp(r"<[^>]*>|[\t\n\r ]|&[^;]+;")

Implementation

int get characterCount => html.replaceAll(RegExp(r"<[^>]*>|[\t\n\r ]|&[^;]+;"), "").trim().length;