Click here to Skip to main content
15,741,892 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created one Name list. In this list contains lot of names. some names are contains repeated also. so i need to find the indexs of the names. for example Name is Raju. its repeat in 5 times i wanna find the index of every name.

here the detail coding
List<string> listLog = listLog1.GetRange(sindexs, eindex);

in this case the "Listlog" contains all Names.
2.List<string> listLog1 = (List<string>)(from item in values where item.StartsWith("Patient Configuration Change Occurred") select item).ToList();
in this line i can find how many repeatations.
So i wanna know how to find the indexs of each and every "Patient Configuration Change Occurred"
Help me..
Updated 29-Oct-12 0:04am

1 solution

With out more detail, look at the List.IndexOf[^] method. It has versions to return the first, and the next - by using the index of the previous plus one as the start address of the next.

Alternatively, you could use Linq to produce the list with a simple Select or Where call.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900