Count number of characters in an ANSI colored stringSource:
This is a color-aware counterpart of
utf8_nchar(). By default it
counts Unicode grapheme clusters, instead of code points.
ansi_nchar(x, type = c("chars", "bytes", "width", "graphemes", "codepoints"))
Character vector, potentially ANSI styled, or a vector to be coerced to character. If it converted to UTF-8.
Whether to count graphemes (characters), code points, bytes, or calculate the display width of the string.