Array.pad()

From ZCubes Wiki
Revision as of 16:54, 4 March 2017 by Joseph (talk | contribs)
Jump to navigation Jump to search


Array.pad(NewLength, PadString)

Pad the array to be of length NewLength, and fill the extra elements added with PadString (default 0) if given.

[1,2,3].pad(10,3) [1, 2, 3, 3, 3, 3, 3, 3, 3, 3]


["TEST","CAR"].pad(10,"TEST") ["TEST", "CAR", "TEST", "TEST", "TEST", "TEST", "TEST", "TEST", "TEST", "TEST"]