Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Treatment split

std/text/compose::split


Parameters

↳ var delimiter: string
↳ var inclusive: bool = true

Inputs

⇥ text: Stream<string>

Outputs

↦ splitted: Stream<Vec<string>>


Split strings with delimiter.

text is splitted according to delimiter, and streamed as splitted vector.

  • inclusive: set if the delimiter must be kept at the end of splitted strings (if present).
graph LR
     T("split()")
     B["🟦"] -->|vector| T
     
     T -->|value| O["[🟦 🟦 🟦]"]

     style B fill:#ffff,stroke:#ffff
     style O fill:#ffff,stroke:#ffff