use center to create a comment: : Justify Center « String « Ruby






use center to create a comment:


filename = "hack.rb" # => "hack.rb"
filename.size # => 7
filename.center 40-7, "#" # => "#############hack.rb#############"

 








Related examples in the same category

1.Center a string
2.Center a string by filling
3.play both ends to the middle
4.one space longer than the word