Legacy Documentation

Mathematica® Teacher's Edition (2002)

This is documentation for an obsolete product.
Current products and services
 Documentation /  Mathematica Teacher's Edition /  Built-in Functions /  Lists and Matrices /  List Operations /

ReplacePart

FilledSmallSquare ReplacePart[expr, new, n] yields an expression in which the n part of expr is replaced by new.
FilledSmallSquare ReplacePart[expr, new, i, j, ... ] replaces the part at position i, j, ... .
FilledSmallSquare ReplacePart[expr, new, , , ... , , , ... , ... ] replaces parts at several positions by new.
FilledSmallSquare ReplacePart[expr, new, pos, npos] replaces parts at positions pos in expr by parts at positions npos in new.

FilledSmallSquare Example: ReplacePart[a, b, c, d, x, 3]LongRightArrow.
FilledSmallSquare The list of positions used by ReplacePart is in the same form as is returned by the function Position.
FilledSmallSquare If pos and npos both specify multiple parts, each part in pos is replaced by the corresponding part in npos.
FilledSmallSquare See The Mathematica Book on the web: Section 1.8.6 and Section 2.1.4.
FilledSmallSquare See also: Part, Extract, Insert, Delete.