| ansi_trimws | R Documentation |
This function is similar to base::trimws() but works on ANSI strings,
and keeps color and other styling.
ansi_trimws(x, which = c("both", "left", "right"))
x |
ANSI string vector. |
which |
Whether to remove leading or trailing whitespace or both. |
ANSI string, with the whitespace removed.
Other ANSI string operations:
ansi_align(),
ansi_columns(),
ansi_nchar(),
ansi_strsplit(),
ansi_strtrim(),
ansi_strwrap(),
ansi_substr(),
ansi_substring(),
ansi_toupper()
trimws(paste0(" ", col_red("I am red"), " "))
ansi_trimws(paste0(" ", col_red("I am red"), " "))
trimws(col_red(" I am red "))
ansi_trimws(col_red(" I am red "))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.