split row for strings

Split a string into multiple rows using a separator.

Signature

> split row (separator) --number

Parameters

  • separator: the character that denotes what separates rows
  • --number {int}: Split into maximum number of items

Examples

Split a string into rows of char

> 'abc' | split row ''
╭───┬───╮
│ 0 │   │
│ 1 │ a │
│ 2 │ b │
│ 3 │ c │
│ 4 │   │
╰───┴───╯

Split a string into rows by the specified separator

> 'a--b--c' | split row '--'
╭───┬───╮
│ 0 │ a │
│ 1 │ b │
│ 2 │ c │
╰───┴───╯

Split a string by '-'

> '-a-b-c-' | split row '-'
╭───┬───╮
│ 0 │   │
│ 1 │ a │
│ 2 │ b │
│ 3 │ c │
│ 4 │   │
╰───┴───╯