| title | bytes split |
|---|---|
| categories | bytes |
| version | 0.109.0 |
| bytes | Split input into multiple items using a separator. |
| usage | Split input into multiple items using a separator. |
| editLink | false |
| contributors | false |
bytes split for bytes
Split input into multiple items using a separator.
> bytes split {flags} (separator)
separator: Bytes or string that the input will be split on (must be non-empty).
| input | output |
|---|---|
| binary | list<binary> |
Split a binary value using a binary separator
> 0x[66 6F 6F 20 62 61 72 20 62 61 7A 20] | bytes split 0x[20]
╭───┬─────────────────╮
│ 0 │ [102, 111, 111] │
│ 1 │ [98, 97, 114] │
│ 2 │ [98, 97, 122] │
│ 3 │ [] │
╰───┴─────────────────╯
Split a binary value using a string separator
> 0x[61 2D 2D 62 2D 2D 63] | bytes split "--"
╭───┬──────╮
│ 0 │ [97] │
│ 1 │ [98] │
│ 2 │ [99] │
╰───┴──────╯