Skip to main content

strip_ansi_codes

Function strip_ansi_codes 

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

Strip ANSI escape codes from text, returning a borrowed Cow when the input contains no ESC byte. This is the preferred API for call-sites that want to avoid allocation on the common “no ANSI codes” path.