nushell/docs/commands/str-substring.md
Fernando Herrera dbcadbc12c moved folders
2022-02-07 19:23:12 +00:00

801 B

str substring

substrings text

Usage

> str substring <range> ...args {flags} 

Parameters

  • <range> the indexes to substring [start end]
  • ...args: optionally substring text by column paths

Flags

  • -h, --help: Display this help message

Examples

Get a substring from the text

> echo 'good nushell' | str substring [5 12]

Alternatively, you can use the form

> echo 'good nushell' | str substring '5,12'

Drop the last n characters from the string

> echo 'good nushell' | str substring ',-5'

Get the remaining characters from a starting index

> echo 'good nushell' | str substring '5,'

Get the characters from the beginning until ending index

> echo 'good nushell' | str substring ',7'