Mega Code Archive
Categories
/
Ruby
/
String
The added whitespace is calculated based on the length of the string plus the value of the argument
title = "AAA" puts title.ljust 20 puts title.rjust 25