size for strings

Gather word count statistics on the text.

Signature

> size

Examples

Count the number of words in a string

> "There are seven words in this sentence" | size
╭───────────┬────╮
│ lines     │ 1  │
│ words     │ 7  │
│ bytes     │ 38 │
│ chars     │ 38 │
│ graphemes │ 38 │
╰───────────┴────╯

Counts unicode characters

> '今天天气真好' | size
╭───────────┬────╮
│ lines     │ 1  │
│ words     │ 6  │
│ bytes     │ 18 │
│ chars     │ 6  │
│ graphemes │ 6  │
╰───────────┴────╯

Counts Unicode characters correctly in a string

> "Amélie Amelie" | size
╭───────────┬────╮
│ lines     │ 1  │
│ words     │ 2  │
│ bytes     │ 15 │
│ chars     │ 14 │
│ graphemes │ 13 │
╰───────────┴────╯