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 :: ##[error]Dotnet command failed with non-zero exit code on the following projects 
Csharp :: c# float min value 
Csharp :: web.config customerrors not working 
Csharp :: unity script template folder 
Csharp :: StringFormat C# 
Csharp :: display image script unity 
Csharp :: unity GUI TextField enter 
Csharp :: gql query with parameters 
Csharp :: C# Async Function with await 
Csharp :: c# list object 
Csharp :: c# textbox kodu 
Csharp :: c# new object 
Csharp :: how to move mouse with c# 
Csharp :: install active directory windows server 2019 powershell 
Csharp :: generic interface c# 
Csharp :: c# array lenght 
Csharp :: camelCase and snakeCase 
Csharp :: orderby c# 
Csharp :: how to create a string in c# 
Csharp :: System.Collections.Generic.List`1[System.Int32] c# fix 
Csharp :: vb.net read registry key as string 
Csharp :: dotnet core clickable row 
Csharp :: internal working of ioc container c# 
Csharp :: camera follow player unity 
Csharp :: html inside razor 
Csharp :: enzymes chemical factory 
Csharp :: unity time.fixeddeltatime 
Csharp :: delay a function on winform 
Csharp :: Zxing Xamarin use front Camera 
Csharp :: Deserialize a Dictionary 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =