This function is similar to base::strtrim()
, but works correctly with
ANSI styled strings. It also adds ...
(or the corresponding Unicode
character if Unicode characters are allowed) to the end of truncated
strings.
Usage
ansi_strtrim(x, width = console_width(), ellipsis = symbol$ellipsis)
See also
Other ANSI string operations:
ansi_align()
,
ansi_columns()
,
ansi_nchar()
,
ansi_strsplit()
,
ansi_strwrap()
,
ansi_substr()
,
ansi_substring()
,
ansi_toupper()
,
ansi_trimws()