Introduce Variable

To introduce a new variable from an existing expression, select it and press Ctrl+Alt+V, then specify the name and type.

Alternatively you can open the Refactor menu and select Introduce Variable


Some very cool neat stuff below

When you select an expression inside of a for statement, then, if it matches successfully against a pattern in generator or enumerator of that statement, the selected expression is extracted into a separate enumerator within the same for statement.

Before After
Pay attention to the result variable that is created via the use of this refactoring.

Labels

 
(None)