-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed

Description
The following text is incorrect:
The newer using statement syntax translates to similar code. The try block opens where the variable is declared. The finally block is added at the close of the enclosing block, typically at the end of a method.
It should read:
The newer using declaration syntax translates to similar code. The try block opens where the variable is declared. The finally block is added at the close of the enclosing block, typically at the end of a method.
Further down the page, you might also want to add the following format, which is much nicer to read:
using (StringReader left = new StringReader(numbers)
using (StringReader right = new StringReader(letters))
{
string? item;
do
{
item = left.ReadLine();
Console.Write(item);
Console.Write(" ");
item = right.ReadLine();
Console.WriteLine(item);
} while (item != null);
}
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
- ID: 042902cc-1598-5df1-34cc-caa0fad63e02
- Version Independent ID: e186d0c4-523e-38f7-2cde-d00109ea784b
- Content: using statement - C# Reference
- Content Source: docs/csharp/language-reference/keywords/using-statement.md
- Product: dotnet-csharp
- Technology: csharp-language-reference
- GitHub Login: @BillWagner
- Microsoft Alias: wiwagn