pub fn read_next_sequence(s: &str) -> (&str, Option<Escape>, &str)
Expand description

Read the next sequence in the given slice. Returns the content before the escape sequence, the escape sequence itself, and everything following it. The escape sequence can be None if it’s invalid. If the slice doesn’t contain an escape sequence the entire string slice will be returned as the first item.

let (pre, esc, post) = yew_ansi::read_next_sequence("Hello \u{001b}[32mWorld");
assert_eq!(pre, "Hello ");
assert_eq!(
    esc,
    Some(Escape::Csi(Csi::Sgr(vec![
        Sgr::ColorFgName(ColorName::Green),
    ])))
);
assert_eq!(post, "World");