Issue #5552 has been updated by Tsuyoshi Sawada.


And also `Array#center` analogous to `String#center` as well.
----------------------------------------
Feature #5552: Array#ljust, Array#rjust
http://redmine.ruby-lang.org/issues/5552

Author: Tsuyoshi Sawada
Status: Open
Priority: Normal
Assignee: 
Category: 
Target version: 


I propose the following methods Array#ljust(length [, pad]), Array#rjust(length [, pad]), whose behaviour is analogous to String#ljust(length [, padstr]), String#rjust(length [, padstr]).

    [:a, :b, :c].ljust(2) #=> [:a, :b, :c]
    [:a, :b, :c].ljust(5) #=> [:a, :b, :c, nil, nil]
    [:a, :b, :c].ljust(5, :x) #=> [:a, :b, :c, :x, :x]


-- 
http://redmine.ruby-lang.org