原创[477,4770,]
预期[“477”,“4770”]
我怎么能用Ruby做到这一点?
ljust
arr = [477,4770] strings = arr.map { |number| number.to_s.ljust(5) } # => ["477 ","4770 "]
祝好运!