The Introduce Variable refactoring allows you to define a local variable for a selected expression, initialize the variable with the selected expression and replace the selected code with the newly defined variable.
Not relevant: ASP.NET, XAML, HTML
To introduce a variable
Select an expression.
Press Alt+Insert. From the pop-up menu, select Introduce Variable.
Enter a name for the new variable or choose one of the suggested names.
- Press Enter to finish or Esc to abort the operation.
To introduce a variable you can also navigate on the main menu. Choose JustCode | Refactor | Introduce Variable, or just press Ctrl+R, Ctrl+V
You can toggle name suggestions for variable name from JustCode Options dialog.
Introduce Variable works with a selected expression where the expression can be any valid variable initializer.