split chars
for strings> split chars {flags}
--grapheme-clusters, -g
: split on grapheme clusters--code-points, -c
: split on code points (default; splits combined characters)input | output |
---|---|
list<string> | list<list<string>> |
string | list<string> |
Split the string into a list of characters
>'hello'|split chars
╭───┬───╮
│0│h│
│1│e│
│2│l│
│3│l│
│4│o│
╰───┴───╯
Split on grapheme clusters
>'🇯🇵ほげ'|split chars-g
╭───┬────╮
│0│🇯🇵│
│1│ほ│
│2│げ│
╰───┴────╯
Split multiple strings into lists of characters
> ['hello', 'world'] |split chars
╭───┬───────────╮
│0│╭───┬───╮│
│││0│h││
│││1│e││
│││2│l││
│││3│l││
│││4│o││
││╰───┴───╯│
│1│╭───┬───╮│
│││0│w││
│││1│o││
│││2│r││
│││3│l││
│││4│d││
││╰───┴───╯│
╰───┴───────────╯
Copyright © 2019–2023 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/split_chars.html