Skip to content

ReplaceAll

ReplaceAll(expr, i -> new)

or

expr /. i -> new

replaces all i in expr with new.

ReplaceAll(expr, {i1 -> new1, i2 -> new2, ... } )

or

expr /. {i1 -> new1, i2 -> new2, ... }

replaces all is in expr with news.

Examples

>> f(a) + f(b) /. f(x_) -> x^2
a^2+b^2

Dispatch, Replace, ReplaceList, ReplacePart, ReplaceRepeated

Implementation status

  • ✅ - full supported

Github