Finding the last index of an array
With C# 8:
int[] array = { 1, 3, 5 };
var lastItem = array[^1]; // 5
LINQ provides Last():
csharp> int[] nums = {1,2,3,4,5};
csharp> nums.Last();
5
This is handy when you don't want to make a variable unnecessarily.
string lastName = "Abraham Lincoln".Split().Last();