strip_ansi: Strip ANSI escape sequences from a string

View source: R/log.R

strip_ansiR Documentation

Strip ANSI escape sequences from a string

Description

Removes the SGR / CSI escapes commonly produced by fmt() (and by any other tool that writes coloured terminal output). Safe to call on plain input - returns it unchanged.

Usage

strip_ansi(x)

Arguments

x

Character: Input.

Value

Character: x with ANSI escapes removed.

Author(s)

EDG

Examples

strip_ansi(fmt("hi", col = "red"))

rtemis.core documentation built on Sept. 20, 2026, 9:06 a.m.