Function get_blocks

Source
pub fn get_blocks(text: &str) -> AnsiBlockIter<'_> 
Expand description

This function returns a Iterator which produces a AnsiBlock.

AnsiBlock represents a string with a consisten style.

§Example

use ansi_str::get_blocks;

let text = "\u{1b}[31;40mHello\u{1b}[0m \u{1b}[31mWorld!\u{1b}[39m";

for block in get_blocks(&text) {
    println!("{:?}", block.text());
}