Extract Parameter

Extract code to a parameter in Kotlin.

00:00
00:12

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

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


Related Resources

Guard conditions
Guard conditions
Create advanced control flows in when statements
Non-local break & continue
Non-local break & continue
Making inline lambdas truly first-class citizens
Multi-dollar String Interpolation in Kotlin
Multi-dollar String Interpolation in Kotlin
Improve $ handling in string literals