1
1
Fork 0
AtomicKotlinCourse/Programming Basics/Repetition with while/Exercise 5/task.md

712 B

Mastering the IDE: Extract Variable

IntelliJ IDEA can extract a val or var automatically. Select the expression getFooResult() inside a string template, then do one of the following:

  • Invoke Find action (by pressing &shortcut:GotoAction;), then type Extract variable to find the corresponding action

  • Press &shortcut:IntroduceVariable;;

  • Choose Refactor | Extract | Variable... in the application menu.

Type the name of the new variable. IntelliJ IDEA tries to suggest a name based on the expression. Press &shortcut:EditorEnter; to finish.