Skip to content

ReplaceAll (/.)

Replaces parts of an expression according to rules.

$ wo '{a, b} /. a -> x'
{x, b}
$ wo '{x^2, y^2} /. x -> 2'
{4, y^2}

An applied anonymous function may carry a replacement, which applies to the result of the application:

$ wo '(# + 1) &[2] /. 3 -> 9'
9