get first and last item list c#
C#
List<string> _ids = new List<string>() { "aaa", "bbb", "ccc", "ddd" };
var first = _ids[0]; //first element
var last = _ids[_ids.Count - 1]; //last elementList<string> _ids = new List<string>() { "aaa", "bbb", "ccc", "ddd" };
var first = _ids.First();
var last = _ids.Last();
Console.WriteLine(first);
Console.WriteLine(last);
Also in C#:
- Title
- panel drag all form c#
- Category
- C#
- Title
- c# instantiate
- Category
- C#
- Title
- how to go to other forms in C#
- Category
- C#
- Title
- c# get list of all class fields
- Category
- C#
- Title
- console application in c# ms crm
- Category
- C#
- Title
- c# zip a file
- Category
- C#
- Title
- how to convert iformfile to byte array c#
- Category
- C#
- Title
- unity transfoprm position y change
- Category
- C#
- Title
- cursorlockmode cannot be used as a method C#
- Category
- C#
- Title
- unity c# get bool from another script
- Category
- C#
- Title
- C# previous method
- Category
- C#
- Title
- unity rotate object c#
- Category
- C#
- Title
- how to switch scenes unity
- Category
- C#
- Title
- c# reverse a string
- Category
- C#
- Title
- how to change the title of the console in c#
- Category
- C#
- Title
- c# loop through repeater items
- Category
- C#
- Title
- c# round number up
- Category
- C#
- Title
- c# anonymous class
- Category
- C#
- Title
- unity ui change sprite
- Category
- C#
- Title
- c# form set auto scale
- Category
- C#
- Title
- unity input get axis
- Category
- C#
- Title
- c# find process by name
- Category
- C#
- Title
- xarray: create 2d dataset
- Category
- C#
- Title
- .net core get image from url
- Category
- C#
- Title
- How to look at an object unity
- Category
- C#
- Title
- c# replace string case insensitive
- Category
- C#
- Title
- unity making homing rocket
- Category
- C#
- Title
- unity onclick addlistener
- Category
- C#
- Title
- unity rigidbody constraints
- Category
- C#
- Title
- override Microsoft.AspNetCore.Authorization.AuthorizeAttribute
- Category
- C#
- Title
- configure 1 to 1 relation ef
- Category
- C#
- Title
- loop gridcontrol devexpress c#
- Category
- C#
- Title
- ecs get specific entities with component
- Category
- C#
- Title
- dynamically add rows to datagridview c#
- Category
- C#
- Title
- unity check when clicked on object
- Category
- C#
- Title
- C# save pdf stream to file
- Category
- C#
- Title
- can send but cannot receive email dreamhost email
- Category
- C#
- Title
- c# foreach namevaluecollection
- Category
- C#
- Title
- unity on trigger enter
- Category
- C#
- Title
- unity c# run a command then wait
- Category
- C#
- Title
- how to get joypad axis input unity
- Category
- C#
- Title
- select a whole row out of a 2d array C#
- Category
- C#
- Title
- unity particle system color
- Category
- C#
- Title
- c# ?
- Category
- C#
- Title
- C# get all files in directory
- Category
- C#
- Title
- c# listview
- Category
- C#
- Title
- C# get all child classes of a class
- Category
- C#
- Title
- c# how to use inovke
- Category
- C#
- Title
- mouseposition unity
- Category
- C#
- Title
- how to name GameObject in c#
- Category
- C#
- Title
- unity set sprite transparency
- Category
- C#
- Title
- how to generate random unique id in c#
- Category
- C#
- Title
- how to trim path in C#
- Category
- C#
- Title
- rotatearound unity
- Category
- C#
- Title
- unity persistent data
- Category
- C#
- Title
- unity set object scale
- Category
- C#
- Title
- c# string list contains
- Category
- C#
- Title
- c# one line set
- Category
- C#
- Title
- unity ui not seen
- Category
- C#
- Title
- check if multiple variables are null c#
- Category
- C#
- Title
- gfortran: declare an array
- Category
- C#
- Title
- sort c#
- Category
- C#
- Title
- countdown script in unity
- Category
- C#
- Title
- .net loop through dictionary
- Category
- C#
- Title
- membership get user id
- Category
- C#
- Title
- C# webclient submit form
- Category
- C#
- Title
- unity how to end a game with esc
- Category
- C#
- Title
- how to convert a number to 2 decimal places in c#
- Category
- C#
- Title
- dto and automapper
- Category
- C#
- Title
- while loop check condition c#
- Category
- C#
- Title
- how to get the last element in an array in c#
- Category
- C#
- Title
- asp.net render control to string
- Category
- C#
- Title
- c# query string builder
- Category
- C#
- Title
- c# new list object
- Category
- C#
- Title
- stop ui from clipping wall
- Category
- C#
- Title
- unity assign button onclick
- Category
- C#
- Title
- decimals not stored in azure tables
- Category
- C#
- Title
- c# change label forecolor code
- Category
- C#
- Title
- c# store generic type without arguments
- Category
- C#
- Title
- rotation unity script 2d
- Category
- C#
- Title
- xamarin forms alarm
- Category
- C#
- Title
- convert string to datetime c#
- Category
- C#
- Title
- how to put double quotes in a string c#
- Category
- C#
- Title
- c# scene manager
- Category
- C#
- Title
- what does gameobject.find return
- Category
- C#
- Title
- blazor wasm routable page in separate project
- Category
- C#
- Title
- c# inline if
- Category
- C#
- Title
- c# check to see if dictionary key exists
- Category
- C#
- Title
- how to reference a child object unity
- Category
- C#
- Title
- list contains type c#
- Category
- C#
- Title
- how to textbox anywhere on chart in c#
- Category
- C#
- Title
- C# graph api upload file one drive
- Category
- C#
- Title
- asp textarea
- Category
- C#
- Title
- unity how to check object position
- Category
- C#
- Title
- c# wait for seconds
- Category
- C#
- Title
- c# method info extension
- Category
- C#
- Title
- get random point within radius
- Category
- C#
- Title
- uwp file open picker
- Category
- C#
- Title
- native-googlesignin configuration is null!?
- Category
- C#
- Title
- C# Unknown column 'FundAllocation' in 'field list
- Category
- C#