[R-pkgs] New Package fansi: ANSI Control Sequence Aware String Functions
fansi provides counterparts to the base string manipulation functions substr, strwrap, strtrim, strsplit, and n(z)char that account for ANSI CSI SGR control sequences. ANSI CSI SGR control sequences  can be used to format text in terminals that support them.
For example the control sequence "\033[31m" causes text that follows to render in red, and the control sequence "\033[0m" turns off formatting. So with:
we extract the second letter of the red formatted ABC while retaining the formatting.
fansi is written mostly in C, so its performance is comparable to the corresponding base functions. There are versions of some of the functions with additional functionality. For example, `substr2_ctl` supports character-width (as opposed to character-count) based substrings.