Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
23
pub 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_length
Function · 0.85
Calls
1
new
Function · 0.85
Tested by
no test coverage detected