split words
for strings> split words {flags}
--min-word-length, -l {int}
: The minimum word length--grapheme-clusters, -g
: measure word length in grapheme clusters (requires -l)--utf-8-bytes, -b
: measure word length in UTF-8 bytes (default; requires -l; non-ASCII chars are length 2+)input | output |
---|---|
list<string> | list<list<string>> |
string | list<string> |
Split the string's words into separate rows
>'hello world'|split words
╭───┬───────╮
│0│hello│
│1│world│
╰───┴───────╯
Split the string's words, of at least 3 characters, into separate rows
>'hello to the world'|split words-l3
╭───┬───────╮
│0│hello│
│1│the│
│2│world│
╰───┴───────╯
A real-world example of splitting words
>http gethttps://www.gutenberg.org/files/11/11-0.txt|str downcase|split words-l2|uniq-c|sort-bycount--reverse|first10
Copyright © 2019–2023 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/split_words.html