Description Usage Arguments Value See Also Examples
This is a color-aware counterpart of base::nchar()
,
which does not do well, since it also counts the ANSI control
characters.
1 | ansi_nchar(x, type = c("chars", "bytes", "width"), ...)
|
x |
Character vector, potentially ANSO styled, or a vector to be coarced to character. |
type |
Whether to count characters, bytes, or calculate the
display width of the string. Passed to |
... |
Additional arguments, passed on to |
Numeric vector, the length of the strings in the character vector.
Other ANSI string operations:
ansi_align()
,
ansi_columns()
,
ansi_strsplit()
,
ansi_strtrim()
,
ansi_strwrap()
,
ansi_substring()
,
ansi_substr()
,
ansi_toupper()
,
ansi_trimws()
1 2 3 4 5 6 7 8 9 10 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.