The Extract Constant refactoring creates a constant which holds the selected expression as the value and replaces its occurrences by reference to this newly created constant.

In order to invoke the refactoring, select an expression to be replaced with a constant or place the caret over an expression and press &shortcut:IntroduceConstant; (Refactor | Extract -> Constant... ):

This will result in the following: