CLion
 
Get CLion
Join the CLion 2025.1 Early Access Program and try out new features before they are released! Find out more

Extract/Introduce variable

Last modified: 23 October 2024

The Extract Variable refactoring puts the result of the selected expression into a variable. It declares a new variable and uses the expression as an initializer. The original expression is replaced with the new variable.

This refactoring is available for C/C++, Objective-C/C++, Python and JavaScript.