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