The Extract Constant refactoring creates a constant that holds the selected expression as the value and replaces its occurrences with the references to this newly created constant.

To invoke this refactoring, select an expression to be replaced with a constant and press &shortcut:IntroduceConstant; (Refactor | Extract Constant).

This will result in the following: