dotnet / docs

This repository contains .NET Documentation.
https://learn.microsoft.com/dotnet
Creative Commons Attribution 4.0 International
4.13k stars 5.8k forks source link

Indices examples use an array with 10 elements to simplify the tutorial #40607

Closed tymtam2 closed 2 weeks ago

tymtam2 commented 2 weeks ago

Summary

Changes to Indices and ranges tutorial only:

  1. I used array of 10 elements to simply mental math
  2. I used ordinal strings ("first", "second") instead ("The", "quick") to eliminate the need to scroll up to the table declaration to count which index is "fox" etc.
  3. I added comments with outputs of Console.Write[Line]. Without the comment it seems that the Write[Lines] don't improve to the page and could be removed.
  4. I used the existing snippet for table initialisation instead of an inline snipped (i.e. removed duplication).

Internal previews

📄 File 🔗 Preview link
docs/csharp/tutorials/ranges-indexes.md Indices and ranges