Split Initialization from Declaration
Breaks an initialized declaration for a local variable into a declaration and a separate initialization statement.
This refactoring is useful when you need to conditionally initialize a local variable which is currently being initialized inside its declaration. Splitting the initialization from the declaration is the first step in moving toward conditional initialization.
- when the edit cursor, or caret is on a local variable declaration that includes an initialization expression.
- This refactoring is the functional opposite of Move Initialization to Declaration.
- You can control whether the initialization should be placed right below the local variable's declaration or right above this local's first use.
int a = 10;
Dim a As Integer = 10
int a; a = 10;
Dim a As Integer a = 10