library(cli)
ansi_collapse(1)
#> [1] "1"
ansi_collapse(1, style = "head")
#> [1] "1"
ansi_collapse(1, style = "head", width = 70)
#> [1] "1, and 1"
ansi_collapse(1, style = "head", width = 70, last = " and again ")
#> [1] "1 and again 1"
Created on 2023-03-17 with reprex v2.0.2