Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# get last item in list

using System.Linq; // make sure to use System.Linq

List<string> list = new List<string>
{
	"one",
	"two",
	"three",
};
var lastItem = list.LastOrDefault();
//Or
var lastItem = list.Last();
Comment

c# get the last item in a list

var lastItem = integerList.Last();
Comment

c# list get last element

var lastItem = someList{^1];
Comment

f# get last element of list

Seq.last lst
Comment

PREVIOUS NEXT
Code Example
Csharp :: how to get the date of the first day and last day of the week c# 
Csharp :: convert ienumerable to list 
Csharp :: unity rotation 
Csharp :: how to get the width of the screen C# 
Csharp :: c# get month number 
Csharp :: c# byte array to bitmap 
Csharp :: c# cast to type variable 
Csharp :: .net Core Get File Request 
Csharp :: c# linq select from object list 
Csharp :: c# size of enum 
Csharp :: key value pair in c# 
Csharp :: c# declare an int list 
Csharp :: c# search string array 
Csharp :: c# first item i list 
Csharp :: convert.tostring with datetime string 
Csharp :: c# using file.io 
Csharp :: get roaming folder c# 
Csharp :: dotnet build command 
Csharp :: c# color hex 
Csharp :: unity random number 
Csharp :: dynamic arrays in c# 
Csharp :: move files from one directory to another using c# 
Csharp :: read all lines from txt c# 
Csharp :: unity overlapsphere 
Csharp :: 2d rotation unity 
Csharp :: optimistic update 
Csharp :: raycasting in unity 
Csharp :: how to check if the value is alphabet only in c# 
Csharp :: update multiple records with entity framework 
Csharp :: unity print vs debug log 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =