strip_sgr {fansi} | R Documentation |
Strip Control Sequences
Description
This function is deprecated in favor of the strip_ctl
. It
strips CSI SGR and OSC hyperlink sequences.
Usage
strip_sgr(x, warn = getOption("fansi.warn", TRUE))
Arguments
x |
a character vector or object that can be coerced to such. |
warn |
TRUE (default) or FALSE, whether to warn when potentially
problematic Control Sequences are encountered. These could cause the
assumptions |
Value
character vector of same length as x with ANSI escape sequences stripped
Examples
## convenience function, same as `strip_ctl(ctl=c('sgr', 'url'))`
string <- "hello\033k\033[45p world\n\033[31mgoodbye\a moon"
strip_sgr(string)
[Package fansi version 1.0.6 Index]