Check if a string has some ANSI styling
Arguments
- string
The string to check. It can also be a character vector.
- sgr
Whether to look for SGR (styling) control sequences.
- csi
Whether to look for non-SGR control sequences.
- link
Whether to look for ANSI hyperlinks.
See also
Other low level ANSI functions:
ansi_hide_cursor()
,
ansi_regex()
,
ansi_string()
,
ansi_strip()
Examples
## The second one has style if ANSI colors are supported
ansi_has_any("foobar")
#> [1] FALSE
ansi_has_any(col_red("foobar"))
#> [1] TRUE