count method

int count(
  1. String text
)

Returns the number of tokens in text.

Implementation

int count(String text) => encode(text).length;