หมายเหตุ
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลอง ลงชื่อเข้าใช้หรือเปลี่ยนไดเรกทอรีได้
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลองเปลี่ยนไดเรกทอรีได้
This refactoring applies to:
- C#
What: Lets you turn a fragment of code from an existing method into a local function.
When: You have a fragment of existing code in some method that needs to be called from a local function.
Why: You could copy/paste that code, but that would lead to duplication. A better solution is to refactor that fragment into its own local function.
How-to
Highlight the code to be extracted.
Press Ctrl+. to trigger the Quick Actions and Refactorings menu.
Select Extract local function.
