The Extract Variable refactoring wraps a selected expression into a variable. It adds a new variable declaration and uses the expression as an initializer. To invoke this refactoring, select the expression and press &shortcut:IntroduceVariable; (Refactor | Extract | Variable):
This will result in the following: