Replaces element at a specific position.
ReplacePart[expr, i -> new]
ReplacePart[expr, {i1 -> new1, i2 -> new2, …}]
ReplacePart[expr, {i, j, …} -> new]
ReplacePart[expr, {{i1, j1, …} -> new1, …}]
ReplacePart[expr, {{i1, j1, …}, …} -> new]
ReplacePart[i -> new]
ReplacePart[{a, b, c}, 2 -> x]
→ {a, x, c}ReplacePart[{1, 2, 3, 4}, 1 -> 0]
→ {0, 2, 3, 4}ReplacePart[{a, b, c}, -1 -> z]
→ {a, b, z}ReplacePart[{a, b, c}, x, 2]
→ {a, x, c}ReplacePart[{a, b, c, d}, x, {{1}, {3}}]
→ {x, b, x, d}