local function
A method declared inside another method.
A local function is a method nested in another member's body, visible only there; it can capture the enclosing method's locals.
Examples
string Line(string label, decimal amount) => $"{label}: {amount}";written insidePrintReceiptcan be called only fromPrintReceipt.
See also