ReSharper Help  

Inline Variable

The Inline Variable refactoring allows users to replace all occurrences of a given variable in the code with its initializator. To inline a variable position the caret at its name in the editor, and then press Ctrk + Alt + N key shortcut. (Alternatively, one can right-click the mouse on the name of the variable and select Refactor | Inline Variable... from the appearing popup menu.) The variable will be inlined immediately.

Consider the following example:

After we inline the variable k, the code becomes:

Inline Variable refactoring may only be applied to variables whose value is unchanged after initialization. If a variable violates this assumption, the following error message appears:

See Also

Refactoring Code