# Substituting a variable by a value: |

### 5.12.17 Substituting a variable by a value: |

The | operator is an infixed operator that evaluates an expression after giving values to some variables. It does not evaluate the expression before the variables are replaced by the requested values.

- | is an infixed operator, so takes two arguments:
  - expr, an expression depending on one or more variables on the left hand side.
  - x1=a1, ldots; an equality or sequence of several equalities.
- expr|x1=a1,… returns the expression expr with x1 replaced by a1, etc.

#### Examples.

- Input:
  a^2 + 1 | a = 2
  Output (even if a has been assigned a value):

  5

- Input:
  a^2 + b | a = 2, b = 3
  Output (even if a or b had been assigned a value):

  7