Strings In Depth17 / 19
Up next

Pad

label = "hi"
# pad to a width; center splits padding on both sides
puts label.center(8, "*")
puts label.ljust(8, ".")
puts label.rjust(8, ".")
What you're solving

center, ljust, rjust