WORKED CASE · SYNTHETIC TEST DATA

Check what a character counter counts

Character, word and whitespace counts answer different questions.

Input and settings

Hello world

Run and interpret

Expect eleven code units including space, ten excluding whitespace, and two whitespace-delimited words.

Expected output

11
10
2

Scope and possible misuse

Counts use UTF-16 units, not grapheme clusters. Chinese segmentation and linguistic sentence boundaries are not analyzed; reading time is a rough estimate.

Unexpected result? Report a minimal example