Answers for "c# get index of object in list"

C#
6

c# list index

// Get the first item from the list

using System.Linq;

var myList = new List<string>{ "Yes", "No", "Maybe"};
var firstItem = myList.ElementAt(0);

// Do something with firstItem
Posted by: Guest on August-13-2020
1

Get Index position of an element in a list in c#

int index = myList.FindIndex(a => a.Prop == oProp);
Posted by: Guest on April-25-2021

Code answers related to "c# get index of object in list"

C# Answers by Framework

Browse Popular Code Answers by Language