File: ansi_strip.Rd

package info (click to toggle)
r-cran-cli 3.6.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,288 kB
  • sloc: ansic: 16,412; cpp: 37; sh: 13; makefile: 2
file content (36 lines) | stat: -rw-r--r-- 986 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ansiex.R
\name{ansi_strip}
\alias{ansi_strip}
\title{Remove ANSI escape sequences from a string}
\usage{
ansi_strip(string, sgr = TRUE, csi = TRUE, link = TRUE)
}
\arguments{
\item{string}{The input string.}

\item{sgr}{Whether to remove for SGR (styling) control sequences.}

\item{csi}{Whether to remove for non-SGR control sequences.}

\item{link}{Whether to remove ANSI hyperlinks.}
}
\value{
The cleaned up string. Note that \code{ansi_strip()} always drops
the \code{cli_ansi_string} class, even if \code{sgr} and sci\code{are}FALSE`.
}
\description{
The input may be of class \code{cli_ansi_string} class, this is also dropped
from the result.
}
\examples{
ansi_strip(col_red("foobar")) == "foobar"
}
\seealso{
Other low level ANSI functions: 
\code{\link{ansi_has_any}()},
\code{\link{ansi_hide_cursor}()},
\code{\link{ansi_regex}()},
\code{\link{ansi_string}()}
}
\concept{low level ANSI functions}