Introducing Variables

Introduce variables the way you like!

00:00
00:00

Struggling with long lines of code? 🙇‍♀️

Existing expressions can easily be assigned to a new variable using the Introduce Variable refactoring. We can either select the expression and invoke Refactor | Introduce Variable or type .var at the end of the expression to invoke the related postfix template. The refactoring also takes repeated occurrences of our expression into account to reduce code duplication.

Of course, inlining a variable is equally easy using the Refactor | Inline Variable refactoring.

Remember to always use meaningful names! 🏷

See Also


Related Resources

Arrays
Arrays
Arrays are a straightforward and traditional way to work with a set of data.
HashSet<T>
HashSet<T>
Use the HashSet<T> type for high performing data sets with unique elements.
Dictionary<T>
Dictionary<T>
Use the Dictionary<TKey, TValue> type for strongly-typed, dynamic, sets of data stored with keys and values.