C# 8.0 - Index, Range, and the Caret (^) Operator
 operator and System.Index.
using System.Index;
int[] Arr = new int[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
Arr[1] // is 2
Arr[^1] // is 10
Arr[9] // is 10
Arr[^10] // is 1
An important note: when using ^, counting starts from 1, not 0. Be careful.
Next, Range uses the Range object with the .. (dot-dot) operator.
Let me illustrate with examples:
using System.Range;
using System.Index;
int[] Arr = new int[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
// Range of 1st, 2nd, 3rd elements of the Arr array
print(Arr[0..3]); // Result: 1, 2, 3
// You can also use the caret operator together
print(Arr[^0..^3]); // Result: 10, 9, 8
Finally, to use C# 8.0 in Unity, you need to install and configure .NET Core 3.0 or higher.