Use another character besides the default space character if you'd like : Justify Right « String « Ruby






Use another character besides the default space character if you'd like


title = "Love's Labours Lost"
puts title.rjust( 21, "-" )

 








Related examples in the same category

1.Use more than one character the sequence will be repeated
2.Add to both sides
3.Justify at both sides