ReplacePart
replaces part
i
inexpr
withnew
.
replaces parts
i
andj
withe1
, and partsk
andl
withe2
.
Examples
Delayed rules are evaluated once for each replacement:
Non-existing parts are simply ignored:
You can replace heads by replacing part 0
:
Negative part numbers count from the end:
Related terms
Replace, ReplaceAll, ReplaceList, ReplaceRepeated
Implementation status
- ✅ - full supported