List ostring = new List(); ostring.Add(“Archana”); ostring.Add(“P”); ostring.Add(“Parmar”); ostring.Add(“Check”); ostring.Add(“index”);
IEnumerable<int> indexes = (from item1 in ostring where item1== "Check" select ostring.IndexOf(item1)); Console.WriteLine(indexes.FirstOrDefault());
IEnumerable<int> indexes = (from item1 in ostring
where item1== "Check"
select ostring.IndexOf(item1));
Console.WriteLine(indexes.FirstOrDefault());
//Hope you are looking for this //
LINQ does not have an IndexOf method. So to find out index of a specific item we need to use FindIndex as int index = List. FindIndex(your condition);