powered by
Check if a string has some ANSI styling
ansi_has_any(string, sgr = TRUE, csi = TRUE, link = TRUE)
Logical vector, TRUE for the strings that have some ANSI styling.
TRUE
The string to check. It can also be a character vector.
Whether to look for SGR (styling) control sequences.
Whether to look for non-SGR control sequences.
Whether to look for ANSI hyperlinks.
Other low level ANSI functions: ansi_hide_cursor(), ansi_regex(), ansi_string(), ansi_strip()
ansi_hide_cursor()
ansi_regex()
ansi_string()
ansi_strip()
## The second one has style if ANSI colors are supported ansi_has_any("foobar") ansi_has_any(col_red("foobar"))
Run the code above in your browser using DataLab