Skip to main content

strip_ansi

Function strip_ansi 

Source
pub fn strip_ansi(s: &str) -> Cow<'_, str>
Expand description

Removes ANSI escape sequences from s.

Borrows when there is nothing to remove.

use shellgame::ui::text::strip_ansi;

assert_eq!(strip_ansi("\x1b[1;36mahoj\x1b[0m"), "ahoj");