Learn R Programming

crayon (version 1.5.3)

has_style: Check if a string has some ANSI styling

Description

Check if a string has some ANSI styling

Usage

has_style(string)

Value

Logical vector, TRUE for the strings that have some ANSI styling.

Arguments

string

The string to check. It can also be a character vector.

Examples

Run this code
## The second one has style if crayon is enabled
has_style("foobar")
has_style(red("foobar"))

Run the code above in your browser using DataLab