julia
6bb16c2b - strings: fix `lpad`/`rpad` remainder with a `Char` pad (#62837)

Commit
49 days ago
strings: fix `lpad`/`rpad` remainder with a `Char` pad (#62837) When the pad width does not evenly divide the remaining columns, `lpad`/`rpad` filled the last `r` columns with `first(p, r)`. For a `Char` pad `p` this iterates the char into a `Vector{Char}`, which is then stringified into the result: ```julia-repl julia> rpad("x", 6, '🍕') "x🍕🍕['🍕']" ``` Use the whole char instead, matching the string-pad behavior of overshooting the requested width. This also fixes `lpad`/`rpad` failing `--trim=safe` verification through this code path.
Author
Parents
Loading