79425548

Date: 2025-02-09 19:22:02
Score: 1.5
Natty:
Report link

You can find the answer on this page of Microsoft: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-8.0/ranges search on System.Range

The syntax is [startposition ... endposition (excluded)] So if you ask for [2..2] you ask for the items from position 2 till 2 (exclude position 2) - which gives you no results.

If you want to "include" the last item, you enter it as: [2..^2]

Reasons:
  • No code block (0.5):
  • Low reputation (1):
Posted by: lordofcode