Get last element : Last « LINQ « C# / CSharp Tutorial






using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;


public class MainClass{

   public static void Main(string[] args){   
         String[] TestData = {"Zero", "One", "Two", "Three",
                              "Four", "Five", "Six", "Seven", 
                              "Eight", "Nine", "Ten"};
         var ThisQuery = TestData.Last();

         Console.WriteLine("Last Element: " + ThisQuery);
   }
}








22.51.Last
22.51.1.Last Prototype
22.51.2.Last with string operator
22.51.3.Get last element