LANGUAGE
Index from end
Counts positions from the end; ^1 is the last item of a nonempty array.
Formal Syntax & Structure
csharp syntaxcsharp
values[^1]Working Example
Example Snippetcsharp
int[] a = [1, 2]; int last = a[^1];Counts positions from the end; ^1 is the last item of a nonempty array.
values[^1]int[] a = [1, 2]; int last = a[^1];