Skip to content

Commit

Permalink
Fix code sample issue (#9186)
Browse files Browse the repository at this point in the history
* Fix code sample issue

* Additional refinements.
  • Loading branch information
eiriktsarpalis authored Feb 14, 2024
1 parent 22477f6 commit 692ff04
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions release-notes/9.0/preview/preview1/libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ The new `Index` method makes it possible to quickly extract the implicit index o

```C#
IEnumerable<string> lines = File.ReadAllLines("file.txt");
foreach ((string line, int index) in lines.Select((line, index) => (line, index))
foreach ((int index, string line) in lines.Select((line, index) => (index, line)))
{
Console.WriteLine($"Line number: {index + 1}, Line: {line}");
}
Expand All @@ -91,7 +91,7 @@ foreach ((string line, int index) in lines.Select((line, index) => (line, index)
Now becomes

```C#
foreach ((string line, int index) in lines.Index())
foreach ((int index, string line) in lines.Index())
{
Console.WriteLine($"Line number: {index + 1}, Line: {line}");
}
Expand Down

0 comments on commit 692ff04

Please sign in to comment.