int[] array = { 1, 3, 5 };
var lastItem = array[^1]; // 5
string[] str = new string[] {"Java","HTML","jQuery"};
Console.WriteLine("Last element: "+str[str.Length - 1])
string[] items = GetAllItems();
string lastItem = items[items.Length - 1];
int arrayLength = array.Length;
string lastName = "Abraham Lincoln".Split().Last();
int[] arr = [1, 3, 8, 0];
int lastelement = arr[arr.Length]