This is documentation for Mathematica 5, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

Documentation / Mathematica / Built-in Functions / Lists and Matrices / List Operations /

PadRight

FilledSmallSquare PadRight[list, n] makes a list of length n by padding list with zeros on the right.

FilledSmallSquare PadRight[list, n, x] pads by repeating the element x.

FilledSmallSquare PadRight[list, n, , , ... ] pads by cyclically repeating the elements .

FilledSmallSquare PadRight[list, n, padding, m] leaves a margin of m elements of padding on the left.

FilledSmallSquare PadRight[list, , , ... ] makes a nested list with length at level i.

FilledSmallSquare PadRight[list, n, ... ] always returns a list of length n.

FilledSmallSquare Example: PadRight[a,b,c, 7] LongRightArrow.

FilledSmallSquare With padding , , ... cyclic repetitions of the are effectively laid down and then the list is superimposed on top of them, with the first element of the list lying on an occurrence of .

FilledSmallSquare Examples: PadRight[a,b, 7, x,y,z] LongRightArrow.

FilledSmallSquare PadRight[a,b, 7, x,y,z, 2] LongRightArrow.

FilledSmallSquare See additional notes for PadLeft.

FilledSmallSquare See Section 1.8.9, Section 2.4.3 and Section 2.4.4.

FilledSmallSquare See also: PadLeft, Join, Partition, ListCorrelate, RotateRight.

FilledSmallSquare New in Version 4.

Further Examples