The Extract Constant refactoring creates a constant that holds the selected expression as the value and replaces its occurrences as the references to this newly created constant.
On order 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: