MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / strip_ansi

Function strip_ansi

crates/opencode-util/src/util.rs:24–27  ·  view source on GitHub ↗
(s: &str)

Source from the content-addressed store, hash-verified

22
23pub mod color {
24 pub fn strip_ansi(s: &str) -> String {
25 let re = regex::Regex::new(r"\x1b\[[0-9;]*m").unwrap();
26 re.replace_all(s, "").to_string()
27 }
28
29 pub fn ansi_length(s: &str) -> usize {
30 strip_ansi(s).len()

Callers 1

ansi_lengthFunction · 0.85

Calls 1

newFunction · 0.85

Tested by

no test coverage detected