Extract Variable

Extract code to a variable

Highlight the code you want to extract to a variable and press ⌥⌘V (macOS) / Ctrl+Alt+V (Windows/Linux), to extract it.

Extracting parameters can be useful in improving the readability of your code.

Related Resources

Extract Method
Extract code to a new method
Inline Variable
Inline a variable in your code
Introduce variable
Refactor your code and introduce a new variable