Spec-Zone.ru › Nushell

str stats for strings

Gather word count statistics on the text.

Signature

> str stats {flags}

Input/output types:

input output
string record

Examples

Count the number of words in a string.

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

Counts unicode characters.

> '今天天气真好' | str stats
╭───────────────┬────╮
│ lines         │ 1  │
│ words         │ 6  │
│ bytes         │ 18 │
│ chars         │ 6  │
│ graphemes     │ 6  │
│ unicode-width │ 12 │
╰───────────────┴────╯

Counts Unicode characters correctly in a string.

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

Copyright © 2019–2026 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/str_stats.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API