str substring
for strings> str substring {flags} (range) ...rest
--grapheme-clusters, -g
: count indexes and split using grapheme clusters (all visible chars have length 1)--utf-8-bytes, -b
: count indexes and split using UTF-8 bytes (default; non-ASCII chars have length 2+)range
: the indexes to substring [start end]...rest
: For a data structure input, turn strings at the given cell paths into substringsinput | output |
---|---|
list<string> | list<string> |
record | record |
string | string |
table | table |
Get a substring "nushell" from the text "good nushell" using a range
>'good nushell'|str substring5..12
nushell
Count indexes and split using grapheme clusters
>'๐ฏ๐ตใปใ ใตใ ใดใ'|str substring-g4..6
ใตใ
Copyright ยฉ 2019โ2023 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/str_substring.html